yuqi1129 commented on code in PR #5368:
URL: https://github.com/apache/gravitino/pull/5368#discussion_r1824090884


##########
trino-connector/trino-connector/src/main/java/org/apache/gravitino/trino/connector/catalog/jdbc/postgresql/PostgreSQLDataTypeTransformer.java:
##########
@@ -40,6 +43,15 @@ public class PostgreSQLDataTypeTransformer extends 
GeneralDataTypeTransformer {
   public io.trino.spi.type.Type getTrinoType(Type type) {
     if (type.name() == Name.STRING) {
       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_MICROS;
+      } else {
+        return TimestampType.TIMESTAMP_MICROS;
+      }
+    } else if (Name.TIME == type.name()) {
+      return TimeType.TIME_MICROS;

Review Comment:
   Is the `Time` type in Trino has micro seconds precision?



##########
trino-connector/trino-connector/src/main/java/org/apache/gravitino/trino/connector/catalog/hive/HiveDataTypeTransformer.java:
##########
@@ -32,6 +32,26 @@ public class HiveDataTypeTransformer extends 
GeneralDataTypeTransformer {
   private static final int HIVE_VARCHAR_MAX_LENGTH = 65535;
   private static final int HIVE_CHAR_MAX_LENGTH = 255;
 
+  @Override
+  public io.trino.spi.type.Type getTrinoType(Type type) {
+    boolean unsupportedType = false;
+    if (Type.Name.TIMESTAMP == type.name()) {
+      Types.TimestampType timestampType = (Types.TimestampType) type;
+      if (timestampType.hasTimeZone()) {
+        unsupportedType = true;
+      } else if (Type.Name.TIME == type.name()) {
+        unsupportedType = true;
+      }

Review Comment:
   If (timestampType.hasTimeZone() || Type.Name.TIME == type.name()) {
     throw new TrinoException(
             GravitinoErrorCode.GRAVITINO_UNSUPPORTED_GRAVITINO_DATATYPE,
             "Unsupported gravitino datatype: " + type);
   }



-- 
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]

Reply via email to