You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "xuqianjin (JIRA)" <ji...@apache.org> on 2018/11/23 13:44:00 UTC
[jira] [Updated] (FLINK-10994) The bug of timestampadd handles time
[ https://issues.apache.org/jira/browse/FLINK-10994?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
xuqianjin updated FLINK-10994:
------------------------------
Description:
The error occur when {{timestampadd(MINUTE, 1, time '01:00:00')}} is executed:
java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Long
at org.apache.calcite.rex.RexBuilder.clean(RexBuilder.java:1520)
at org.apache.calcite.rex.RexBuilder.makeLiteral(RexBuilder.java:1318)
at org.apache.flink.table.codegen.ExpressionReducer.reduce(ExpressionReducer.scala:135)
at org.apache.calcite.rel.rules.ReduceExpressionsRule.reduceExpressionsInternal(ReduceExpressionsRule.java:620)
at org.apache.calcite.rel.rules.ReduceExpressionsRule.reduceExpressions(ReduceExpressionsRule.java:540)
at org.apache.calcite.rel.rules.ReduceExpressionsRule$ProjectReduceExpressionsRule.onMatch(ReduceExpressionsRule.java:288)
Compared with {{mysql}} database, I think it should meet the following conditions:
||expression||Expect the result||
|timestampadd(MINUTE, -1, time '00:00:00')|-00:01:00|
|timestampadd(MINUTE, 1, time '00:00:00')|00:01:00|
|timestampadd(MINUTE, 1, time '23:59:59')| 24:00:59|
|timestampadd(SECOND, 1, time '23:59:59')|24:00:00|
|timestampadd(HOUR, 1, time '23:59:59')|24:59:59|
This problem seems to be a bug in calcite. I have submitted isuse to calcite. The following is the link.
CALCITE-2699
was:
The error occur when {{timestampadd(MINUTE, 1, time '01:00:00')}} is executed:
java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Long
at org.apache.calcite.rex.RexBuilder.clean(RexBuilder.java:1520)
at org.apache.calcite.rex.RexBuilder.makeLiteral(RexBuilder.java:1318)
at org.apache.flink.table.codegen.ExpressionReducer.reduce(ExpressionReducer.scala:135)
at org.apache.calcite.rel.rules.ReduceExpressionsRule.reduceExpressionsInternal(ReduceExpressionsRule.java:620)
at org.apache.calcite.rel.rules.ReduceExpressionsRule.reduceExpressions(ReduceExpressionsRule.java:540)
at org.apache.calcite.rel.rules.ReduceExpressionsRule$ProjectReduceExpressionsRule.onMatch(ReduceExpressionsRule.java:288)
Compared with M{{ysql}} database, I think it should meet the following conditions:
||expression||Expect the result||
|timestampadd(MINUTE, -1, time '00:00:00')|NULL|
|timestampadd(MINUTE, 1, time '00:00:00')|00:01:00|
|timestampadd(MINUTE, 1, time '23:59:59')|00:00:59|
|timestampadd(SECOND, 1, time '23:59:59')|00:00:00|
|timestampadd(HOUR, 1, time '23:59:59')|00:59:59|
This problem seems to be a bug in calcite. I have submitted isuse to calcite. The following is the link.
CALCITE-2699
> The bug of timestampadd handles time
> ------------------------------------
>
> Key: FLINK-10994
> URL: https://issues.apache.org/jira/browse/FLINK-10994
> Project: Flink
> Issue Type: Bug
> Components: Table API & SQL
> Affects Versions: 1.6.2, 1.7.1
> Reporter: xuqianjin
> Priority: Major
>
> The error occur when {{timestampadd(MINUTE, 1, time '01:00:00')}} is executed:
> java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Long
> at org.apache.calcite.rex.RexBuilder.clean(RexBuilder.java:1520)
> at org.apache.calcite.rex.RexBuilder.makeLiteral(RexBuilder.java:1318)
> at org.apache.flink.table.codegen.ExpressionReducer.reduce(ExpressionReducer.scala:135)
> at org.apache.calcite.rel.rules.ReduceExpressionsRule.reduceExpressionsInternal(ReduceExpressionsRule.java:620)
> at org.apache.calcite.rel.rules.ReduceExpressionsRule.reduceExpressions(ReduceExpressionsRule.java:540)
> at org.apache.calcite.rel.rules.ReduceExpressionsRule$ProjectReduceExpressionsRule.onMatch(ReduceExpressionsRule.java:288)
> Compared with {{mysql}} database, I think it should meet the following conditions:
> ||expression||Expect the result||
> |timestampadd(MINUTE, -1, time '00:00:00')|-00:01:00|
> |timestampadd(MINUTE, 1, time '00:00:00')|00:01:00|
> |timestampadd(MINUTE, 1, time '23:59:59')| 24:00:59|
> |timestampadd(SECOND, 1, time '23:59:59')|24:00:00|
> |timestampadd(HOUR, 1, time '23:59:59')|24:59:59|
> This problem seems to be a bug in calcite. I have submitted isuse to calcite. The following is the link.
> CALCITE-2699
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)