You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (JIRA)" <ji...@apache.org> on 2018/05/25 17:03:00 UTC

[jira] [Commented] (CALCITE-2328) Operand of Logical And/OR should support type like INT, DOUBLE not only Boolean

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

Julian Hyde commented on CALCITE-2328:
--------------------------------------

I think even the MySQL folks regretted putting in that feature. I don't think we should do it. (Maybe in Babel.)

> Operand of Logical And/OR should support type like INT, DOUBLE 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)