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 2019/12/10 03:33:57 UTC

[GitHub] [flink] lirui-apache commented on a change in pull request #10494: [FLINK-13438][hive] Support date type in Hive

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


With regards,
Apache Git Services