public static TimestampData toTimestampData(DecimalData v, int precision) {
    long epochMills;
    switch (precision) {
      case 0:
        epochMills =
            v.toBigDecimal().setScale(0, RoundingMode.DOWN).longValue() * MILLIS_PER_SECOND;
        return timestampDataFromEpochMills(epochMills);
      case 3:
        epochMills = toMillis(v);
        return timestampDataFromEpochMills(epochMills);
      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