You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by "jack wang (Jira)" <ji...@apache.org> on 2021/06/09 09:27:00 UTC

[jira] [Created] (FLINK-22943) java.lang.ClassCastException: java.time.Instant cannot be cast to java.sql.Timestamp

jack wang created FLINK-22943:
---------------------------------

             Summary: java.lang.ClassCastException: java.time.Instant cannot be cast to java.sql.Timestamp
                 Key: FLINK-22943
                 URL: https://issues.apache.org/jira/browse/FLINK-22943
             Project: Flink
          Issue Type: Bug
          Components: Connectors / Hive
    Affects Versions: 1.13.1
            Reporter: jack wang


Before 3.1.2 of hive version, getQueryCurrentTimestamp return Timestamp. But when hive version is 3.1.2,getCurrentTSMethod invoke return Instant.  So the code `(Timestamp)getCurrentTSMethod.invoke(sessionState)` will result the ClassCastException. It should be compatibility with this situation.

when I use hive dialect to create hive table, it will tirgger this error. The error is below:

Exception in thread "main" java.lang.ClassCastException: java.time.Instant cannot be cast to java.sql.TimestampException in thread "main" java.lang.ClassCastException: java.time.Instant cannot be cast to java.sql.Timestamp at org.apache.flink.table.planner.delegation.hive.HiveParser.setCurrentTimestamp(HiveParser.java:365) at org.apache.flink.table.planner.delegation.hive.HiveParser.startSessionState(HiveParser.java:350) at org.apache.flink.table.planner.delegation.hive.HiveParser.parse(HiveParser.java:218) at org.apache.flink.table.api.internal.TableEnvironmentImpl.executeSql(TableEnvironmentImpl.java:722)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)