[ 
https://issues.apache.org/jira/browse/FLINK-22943?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Rui Li resolved FLINK-22943.
----------------------------
    Resolution: Duplicate

> 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
>            Priority: Major
>
> 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)

Reply via email to