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/09 19:15:21 UTC

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

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

 ##########
 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:
   c&p typo: timestamp => Date

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