public static TimestampData toTimestampData(long v, int precision) {
    switch (precision) {
      case 0:
        if (MIN_EPOCH_SECONDS <= v && v <= MAX_EPOCH_SECONDS) {
          return timestampDataFromEpochMills(v * MILLIS_PER_SECOND);
        } else {
          return null;
        }
      case 3:
        return timestampDataFromEpochMills(v);
      default:
        throw new TableException(
            "The precision value '"
                + precision
                + "' for function "
                + "TO_TIMESTAMP_LTZ(numeric, precision) is unsupported,"
                + " the supported value is '0' for second or '3' for millisecond.");
    }
  }
Converts the Java type used for UDF parameters of SQL TIMESTAMP type ({@link Timestamp}) to
internal representation (long).

<p>Converse of {@link #toSQLTimestamp(long)}.
amoro-format-mixed/amoro-mixed-flink/amoro-mixed-flink-common/src/main/java/org/apache/amoro/flink/util/DateTimeUtils.java