You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Feng Zhu (Jira)" <ji...@apache.org> on 2020/04/08 02:52:00 UTC
[jira] [Comment Edited] (CALCITE-3899) cast( string as date ) throw
exception in dynamic parameter
[ https://issues.apache.org/jira/browse/CALCITE-3899?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17077762#comment-17077762 ]
Feng Zhu edited comment on CALCITE-3899 at 4/8/20, 2:51 AM:
------------------------------------------------------------
It is a legal PrepareStatement.
But it may be difficult to solve the problem in an elegant way until we internally support date/time/timestamp types in Calcite.
was (Author: donnyzone):
It is a legal PrepareStatement.
It may be difficult to solve the problem until we internally support date/time/timestamp types in Calcite.
> 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)