OSDir


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[jira] [Created] (CALCITE-2328) Operand of Logical And/OR should support type like INT, DOUTLE not only boolean


yuqi created CALCITE-2328:
-----------------------------

             Summary: 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
             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:
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




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)