lirui-apache commented on a change in pull request #15995:
URL: https://github.com/apache/flink/pull/15995#discussion_r641256685



##########
File path: 
flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/planner/delegation/hive/HiveParser.java
##########
@@ -357,8 +358,13 @@ private static void 
setCurrentTimestamp(HiveParserSessionState sessionState) {
         if (setCurrentTSMethod != null) {
             try {
                 setCurrentTSMethod.invoke(sessionState);
-                sessionState.hiveParserCurrentTS =
-                        (Timestamp) getCurrentTSMethod.invoke(sessionState);
+                Object currentTs = getCurrentTSMethod.invoke(sessionState);
+                if (currentTs instanceof Instant) {
+                    sessionState.hiveParserCurrentTS = 
Timestamp.from((Instant) currentTs);
+                } else {
+                    sessionState.hiveParserCurrentTS =
+                            (Timestamp) 
getCurrentTSMethod.invoke(sessionState);

Review comment:
       Seems this reflection call is redundant. I'll remove it when merge the 
PR.




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


Reply via email to