lirui-apache commented on a change in pull request #10494: [FLINK-13438][hive] 
Support date type in Hive
URL: https://github.com/apache/flink/pull/10494#discussion_r355829871
 
 

 ##########
 File path: 
flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/client/HiveShimV100.java
 ##########
 @@ -364,9 +366,29 @@ public LocalDateTime toFlinkTimestamp(Object 
hiveTimestamp) {
                return ((Timestamp) hiveTimestamp).toLocalDateTime();
        }
 
+       @Override
+       public Object toHiveDate(Object flinkDate) {
+               ensureSupportedFlinkDate(flinkDate);
+               return flinkDate instanceof Date ? flinkDate : 
Date.valueOf((LocalDate) flinkDate);
+       }
+
+       @Override
+       public LocalDate toFlinkDate(Object hiveDate) {
+               Preconditions.checkArgument(hiveDate instanceof Date,
+                               "Expecting Hive timestamp to be an instance of 
%s, but actually got %s",
 
 Review comment:
   nice catch :)

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to