lirui-apache 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_r314189790
 
 

 ##########
 File path: 
flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/util/HiveTypeUtil.java
 ##########
 @@ -165,9 +166,10 @@ 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();
+                               throw new UnsupportedOperationException(
 
 Review comment:
   Right. But it doesn't seem very useful if the conversion is only a one-way 
trip. For example, users are allowed to insert some low-precision timestamps 
into a Hive table. But they cannot read these timestamps back because we don't 
allow converting Hive timestamp to Flink timestamp, right?

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