diqiu50 commented on code in PR #6657:
URL: https://github.com/apache/gravitino/pull/6657#discussion_r1988261232
##########
trino-connector/trino-connector/src/main/java/org/apache/gravitino/trino/connector/catalog/jdbc/mysql/MySQLDataTypeTransformer.java:
##########
@@ -45,18 +45,36 @@ public io.trino.spi.type.Type getTrinoType(Type type) {
return io.trino.spi.type.VarcharType.createUnboundedVarcharType();
} else if (Name.TIMESTAMP == type.name()) {
Types.TimestampType timestampType = (Types.TimestampType) type;
- if (timestampType.hasTimeZone()) {
- return TimestampWithTimeZoneType.TIMESTAMP_TZ_SECONDS;
- } else {
- return TimestampType.TIMESTAMP_SECONDS;
- }
+ return timestampType.hasTimeZone()
+ ? getTimestampWithTimeZoneType(timestampType.precision())
+ : getTimestampType(timestampType.precision());
} else if (Name.TIME == type.name()) {
- return TimeType.TIME_SECONDS;
+ return getTimeType(((Types.TimeType) type).precision());
}
-
return super.getTrinoType(type);
}
+ private static TimestampWithTimeZoneType getTimestampWithTimeZoneType(int
precision) {
Review Comment:
Time precision values other than 0, 3, 6, 9, etc., are meaningless.
--
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]