[ 
https://issues.apache.org/jira/browse/CALCITE-922?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14968100#comment-14968100
 ] 

Sean Hsuan-Yi Chu commented on CALCITE-922:
-------------------------------------------

1. Now I am addressing [~vladimirsitnikov] comment. Thanks.

2. "Change the test to INTERVAL '2' DAY" would reproduce the same InternalError.

3. Actually, constants on both sides of '*' would NOT reproduce this error. 
The reason is: in SqlMonotonicBinaryOperator.getMonotonicity(), Calcite would 
take a different path if both sides of operator(in this case, it is '*') are 
constants. 

> CAST(...) * (INTERVAL constant) results into Internal Error 
> ------------------------------------------------------------
>
>                 Key: CALCITE-922
>                 URL: https://issues.apache.org/jira/browse/CALCITE-922
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>            Reporter: Sean Hsuan-Yi Chu
>            Assignee: Julian Hyde
>
> For example,
> {code}
> select cast(empno as Integer) * (INTERVAL '1' DAY)
> from emp
> {code}
> results into 
> {code}
> java.lang.AssertionError: Internal error: invalid literal: INTERVAL '1' DAY
> {code}
> The reason is that INTERVAL constant is not extracted properly in the cases 
> where this constant times a CAST() function 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to