mchades commented on code in PR #8216:
URL: https://github.com/apache/gravitino/pull/8216#discussion_r2323951518
##########
trino-connector/trino-connector/src/main/java/org/apache/gravitino/trino/connector/catalog/iceberg/IcebergDataTypeTransformer.java:
##########
@@ -49,6 +49,15 @@ public Type getGravitinoType(io.trino.spi.type.Type type) {
"Iceberg does not support the datatype VARCHAR with length");
}
return Types.StringType.get();
+ } else if (io.trino.spi.type.TimeType.class.isAssignableFrom(typeClass)) {
+ // Iceberg only supports time type with microsecond (6) precision
+ return Types.TimeType.of(TRINO_MICROS_PRECISION);
Review Comment:
Same question as above: How does the behavior compare to the original Trino
Iceberg connector?
##########
trino-connector/trino-connector/src/main/java/org/apache/gravitino/trino/connector/catalog/hive/HiveDataTypeTransformer.java:
##########
@@ -72,6 +75,10 @@ public Type getGravitinoType(io.trino.spi.type.Type type) {
}
return Types.FixedCharType.of(charType.getLength());
+ } else if
(io.trino.spi.type.TimestampType.class.isAssignableFrom(typeClass)) {
+ // When creating a table in Hive, the timestamp data type only supports
not specifying
+ // precision, with the default precision being 3 (milliseconds precision)
+ return Types.TimestampType.withoutTimeZone();
Review Comment:
what's the result of creating a table using data type `timestamp(6)` by the
original Trino Hive connector?
Will it throw an error, or will it silently use `timestamp(3)`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]