TsReaper commented on a change in pull request #9342: [FLINK-13438][hive] Fix 
DataTypes.DATE/TIME/TIMESTAMP support for hive connectors
URL: https://github.com/apache/flink/pull/9342#discussion_r312330806
 
 

 ##########
 File path: 
flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/util/HiveTypeUtil.java
 ##########
 @@ -256,9 +258,9 @@ private static DataType 
toFlinkPrimitiveType(PrimitiveTypeInfo hiveType) {
                        case DOUBLE:
                                return DataTypes.DOUBLE();
                        case DATE:
-                               return DataTypes.DATE();
+                               return DataTypes.DATE().bridgedTo(Date.class);
                        case TIMESTAMP:
-                               return DataTypes.TIMESTAMP();
+                               return 
DataTypes.TIMESTAMP(3).bridgedTo(Timestamp.class);
 
 Review comment:
   Thanks for the discussion on the precision issue. As the default precision 
in hive is 9, the connector will be literally not functional if we directly 
throws an exception. So I think it will be better to log a warning message and 
add in the connector's document that timestamp precision may be lost.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to