You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Zoltan Haindrich (JIRA)" <ji...@apache.org> on 2018/05/25 12:45:00 UTC
[jira] [Commented] (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:comment-tabpanel&focusedCommentId=16490662#comment-16490662 ]
Zoltan Haindrich commented on CALCITE-2328:
-------------------------------------------
I'm not sure if this is a problem...I think even the sql standard doesn't mention this; I have bumped into problems because of this feature when I've used mysql (because it can convert an integer value to boolean; so if someone leaves out a >10 condition somewhere it will just return something.....)
> 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)