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

Julian Hyde commented on CALCITE-3899:
--------------------------------------

[~Zhixiong Chen] In the summary can you please convert SQL keywords to 
upper-case.

[~danny0405] and others, What should be the inferred type of "?"? I don't think 
it's possible to infer a type. And if so, isn't this statement illegal? The 
validator should throw. (Calcite should not throw ClassCastException at 
runtime.)

> cast( string as date ) throw exception in dynamic parameter
> -----------------------------------------------------------
>
>                 Key: CALCITE-3899
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3899
>             Project: Calcite
>          Issue Type: Bug
>    Affects Versions: 1.16.0
>            Reporter: Zhixiong Chen
>            Priority: Major
>
> sql like::
> SELECT   cast( ? as date)
>  FROM
>  Table  group by cast( ? as date)
> the dynamic parameter is string like  '2020-04-07'
>  
> But it throw exception like  java.lang.String cannot be cast to 
> java.lang.Integer
> then I find in calcite plan it will cast string as integer and throw exception
> public Object current(){
>     return (Integer) root.get("?0");
>  }
>  



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

Reply via email to