Hi,
I met some problem when using NOT IN clause.
first I am testing Apache Kylin which depends on calcite, it throws
NullPoint Exception, when NOT IN (x1, x2, x3)
the error stack is:
Caused by: java.lang.NullPointerException
at Baz$1$1.moveNext(ANONYMOUS.java:57)
at
org.apache.calcite.linq4j.EnumerableDefaults.groupBy_(EnumerableDefaults.java:731)
at
org.apache.calcite.linq4j.EnumerableDefaults.groupBy(EnumerableDefaults.java:677)
at
org.apache.calcite.linq4j.DefaultEnumerable.groupBy(DefaultEnumerable.java:301)
at Baz.bind(Baz.java:80)
at
org.apache.calcite.jdbc.CalcitePrepare$CalciteSignature.enumerable(CalcitePrepare.java:281)
at
org.apache.calcite.jdbc.CalciteConnectionImpl.enumerable(CalciteConnectionImpl.java:235)
at
org.apache.calcite.jdbc.CalciteMetaImpl.createIterable(CalciteMetaImpl.java:476)
at
org.apache.calcite.avatica.AvaticaResultSet.execute(AvaticaResultSet.java:184)
at
org.apache.calcite.jdbc.CalciteResultSet.execute(CalciteResultSet.java:63)
at
org.apache.calcite.jdbc.CalciteResultSet.execute(CalciteResultSet.java:42)
at
org.apache.calcite.avatica.AvaticaConnection$1.execute(AvaticaConnection.java:473)
at
org.apache.calcite.jdbc.CalciteMetaImpl.prepareAndExecute(CalciteMetaImpl.java:508)
at
org.apache.calcite.avatica.AvaticaConnection.prepareAndExecuteInternal(AvaticaConnection.java:477)
at
org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:109)
... 85 more
then , I adjust the test case ,and found if the elements number in NOT
IN clause is One , it will work, otherwise it will throw exception.
finally I write a simple in-memory data adapter to test , another weird
thing occurs, no exception, only the first and second elements in NOT IN
clause are effective
Sql statement is:
SELECT t0.\"name\" dp0, t0.\"score\" m0 FROM \"TABLE1\" t0 WHERE
t0.\"score\" NOT IN (88,90,89) LIMIT 20001
The result is:
89
80
80
80
80
I have tried both calcite 1.4 and 1.5
--
-------
Wei Hu