@Override
  public int getDefaultPrecision(SqlTypeName typeName) {
    switch (typeName) {
      case VARCHAR:
      case VARBINARY:
        // Calcite will limit the length of the VARCHAR field to 65536
        return Integer.MAX_VALUE;
      case TIMESTAMP:
        // by default we support timestamp with microseconds precision (Timestamp(6))
        return TimestampType.DEFAULT_PRECISION;
      case TIMESTAMP_WITH_LOCAL_TIME_ZONE:
        // by default we support timestamp with local time zone with microseconds precision
        // Timestamp(6) with local time zone
        return LocalZonedTimestampType.DEFAULT_PRECISION;
    }
    return super.getDefaultPrecision(typeName);
  }
Custom type system for Flink.

<p>Copied from flink-1.18.
amoro-format-mixed/amoro-mixed-flink/amoro-mixed-flink-common/src/main/java/org/apache/amoro/flink/planner/calcite/FlinkTypeSystem.java