You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/12/11 10:51:04 UTC

[GitHub] [flink] Aitozi commented on a diff in pull request #20855: [FLINK-29337][hive] Fix fail to query non-hive table in Hive dialect

Aitozi commented on code in PR #20855:
URL: https://github.com/apache/flink/pull/20855#discussion_r1045211502


##########
flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/planner/delegation/hive/HiveParserUtils.java:
##########
@@ -1689,4 +1694,61 @@ public static boolean isFromTimeStampToDecimal(RelDataType srcType, RelDataType
         return srcType.getSqlTypeName().equals(SqlTypeName.TIMESTAMP)
                 && targetType.getSqlTypeName().equals(SqlTypeName.DECIMAL);
     }
+
+    /**
+     * Helps to migrate the new {@link Schema} to old API methods. HiveCatalog use deprecated {@link
+     * TableSchema}, other catalogs may use the new {@link Schema}. Currently, we use it to unify to
+     * {@link TableSchema}. It should be dropped after dropping {@link TableSchema}.
+     */
+    public static TableSchema fromUnresolvedSchema(Schema schema) {
+        final TableSchema.Builder builder = TableSchema.builder();
+
+        final DataType unresolvedType = DataTypes.TIMESTAMP(3);

Review Comment:
   Hi @luoyuxia , I have a question here, why here unresolvedType is hard coded `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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org