[
https://issues.apache.org/jira/browse/CALCITE-1188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15234386#comment-15234386
]
Wei Hu commented on CALCITE-1188:
---------------------------------
the error stack is as below:
Exception in thread "main" java.sql.SQLException: Error while executing SQL
"select extract (year from D), A, count(0) from "hr" where extract(year from
D) in (1970, 1988) group by extract(year from D ), A limit 10000": null
at org.apache.calcite.avatica.Helper.createException(Helper.java:56)
at org.apache.calcite.avatica.Helper.createException(Helper.java:41)
at
org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:143)
at
org.apache.calcite.avatica.AvaticaStatement.executeQuery(AvaticaStatement.java:186)
at testPs.TestPs.main(TestPs.java:146)
Caused by: java.lang.NullPointerException
at Baz$1$1.moveNext(Unknown Source)
at
org.apache.calcite.linq4j.EnumerableDefaults.groupBy_(EnumerableDefaults.java:819)
at
org.apache.calcite.linq4j.EnumerableDefaults.groupBy(EnumerableDefaults.java:754)
at
org.apache.calcite.linq4j.DefaultEnumerable.groupBy(DefaultEnumerable.java:302)
at Baz.bind(Unknown Source)
at
org.apache.calcite.jdbc.CalcitePrepare$CalciteSignature.enumerable(CalcitePrepare.java:327)
at
org.apache.calcite.jdbc.CalciteConnectionImpl.enumerable(CalciteConnectionImpl.java:281)
at
org.apache.calcite.jdbc.CalciteMetaImpl._createIterable(CalciteMetaImpl.java:545)
at
org.apache.calcite.jdbc.CalciteMetaImpl.createIterable(CalciteMetaImpl.java:536)
at
org.apache.calcite.avatica.AvaticaResultSet.execute(AvaticaResultSet.java:187)
at
org.apache.calcite.jdbc.CalciteResultSet.execute(CalciteResultSet.java:65)
at
org.apache.calcite.jdbc.CalciteResultSet.execute(CalciteResultSet.java:44)
at
org.apache.calcite.avatica.AvaticaConnection$1.execute(AvaticaConnection.java:576)
at
org.apache.calcite.jdbc.CalciteMetaImpl.prepareAndExecute(CalciteMetaImpl.java:578)
at
org.apache.calcite.avatica.AvaticaConnection.prepareAndExecuteInternal(AvaticaConnection.java:581)
at
org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:135)
... 2 more
> NullPointerException in extract with where in clause if field has null value
> ----------------------------------------------------------------------------
>
> Key: CALCITE-1188
> URL: https://issues.apache.org/jira/browse/CALCITE-1188
> Project: Calcite
> Issue Type: Bug
> Affects Versions: 1.7.0
> Reporter: Wei Hu
> Assignee: Julian Hyde
>
> if there was a timestamp or date field F1, the queries below will throw
> nullpointer exception if F1 has null value
> select extract(year from F1) from T where extract(year from F1) in (2004,
> 2005)
> select extract(year from F1) , count(0) from T where extract(year from F1) in
> (2004, 2005) group by extract(year from F1)
> the number of items in WHERE-IN clause must be equal or more than two
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)