You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "yuqi (JIRA)" <ji...@apache.org> on 2018/05/25 12:38:00 UTC
[jira] [Updated] (CALCITE-2328) Operand of Logical And/OR should
support type like INT, DOUTLE not only boolean
[ https://issues.apache.org/jira/browse/CALCITE-2328?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
yuqi updated CALCITE-2328:
--------------------------
Description:
As far as i see , MySQL support the following sql
{code:java}
select id, name from tb where 1 and 1;
select id, name from tb where 1 and true;
{code}
However, calcite would not recognize that sql and says:
{code:java}
Caused by: org.apache.calcite.sql.validate.SqlValidatorException: Cannot apply 'AND' to arguments of type '<INTEGER> AND <INTEGER>'. Supported form(s): '<BOOLEAN> AND <BOOLEAN>'
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.apache.calcite.runtime.Resources$ExInstWithCause.ex(Resources.java:463)
at org.apache.calcite.runtime.Resources$ExInst.ex(Resources.java:572)
... 27 more
{code}
So, I propose if we should introduce more type support for logical AND/OR
was:
As far as i see , MySQL support the following sql
{code:java}
select id, name from tb where 1 and 1;
select id, name from tb where 1 and true;
{code}
However, calcite would not recognize that sql and says:
Caused by: org.apache.calcite.sql.validate.SqlValidatorException: Cannot apply 'AND' to arguments of type '<INTEGER> AND <INTEGER>'. Supported form(s): '<BOOLEAN> AND <BOOLEAN>'
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.apache.calcite.runtime.Resources$ExInstWithCause.ex(Resources.java:463)
at org.apache.calcite.runtime.Resources$ExInst.ex(Resources.java:572)
... 27 more
So, I propose if we should introduce more type support for logical AND/OR
> Operand of Logical And/OR should support type like INT, DOUTLE not only boolean
> -------------------------------------------------------------------------------
>
> Key: CALCITE-2328
> URL: https://issues.apache.org/jira/browse/CALCITE-2328
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.16.0
> Reporter: yuqi
> Assignee: Julian Hyde
> Priority: Minor
> Fix For: 1.17.0
>
>
> As far as i see , MySQL support the following sql
> {code:java}
> select id, name from tb where 1 and 1;
> select id, name from tb where 1 and true;
> {code}
> However, calcite would not recognize that sql and says:
> {code:java}
> Caused by: org.apache.calcite.sql.validate.SqlValidatorException: Cannot apply 'AND' to arguments of type '<INTEGER> AND <INTEGER>'. Supported form(s): '<BOOLEAN> AND <BOOLEAN>'
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
> at org.apache.calcite.runtime.Resources$ExInstWithCause.ex(Resources.java:463)
> at org.apache.calcite.runtime.Resources$ExInst.ex(Resources.java:572)
> ... 27 more
> {code}
> So, I propose if we should introduce more type support for logical AND/OR
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)