It sounds like a bug. Can you log a JIRA case, please? Is it on the Druid adapter? Can you provide a java test case?
Julian > On Feb 5, 2017, at 5:05 PM, Albert <[email protected]> wrote: > >> SELECT "t0"."countryName" AS "d0", SUM(1) AS "m0" >> FROM "wikiticker" "t0" >> GROUP BY "t0"."countryName > > On Sun, Feb 5, 2017 at 2:57 PM, Jiarong Wei <[email protected]> wrote: > >> I recently got an unexpected NullPointerException when parsing SQL (listed >> below) using Calcite: >> >> >>> SELECT "t0"."countryName" "d0", SUM(1) "m0" >>> FROM "wikiticker" "t0" >>> GROUP BY "t0"."countryName >> >> >> Exception in thread "main" java.sql.SQLException: Error while executing SQL >>> "SELECT "t0"."countryName" "d0", >>> SUM(1) "m0" >>> FROM "wikiticker" "t0" >>> GROUP BY "t0"."countryName" >>> ": 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:147) >>> at >>> org.apache.calcite.avatica.AvaticaStatement.executeQuery( >> AvaticaStatement.java:208) >>> at Main.main(Main.java:99) >>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>> at >>> sun.reflect.NativeMethodAccessorImpl.invoke( >> NativeMethodAccessorImpl.java:57) >>> at >>> sun.reflect.DelegatingMethodAccessorImpl.invoke( >> DelegatingMethodAccessorImpl.java:43) >>> at java.lang.reflect.Method.invoke(Method.java:606) >>> at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147) >>> Caused by: java.lang.NullPointerException >>> at >>> org.apache.calcite.interpreter.AggregateNode. >> getAccumulator(AggregateNode.java:134) >>> at >>> org.apache.calcite.interpreter.AggregateNode.< >> init>(AggregateNode.java:86) >>> at org.apache.calcite.interpreter.Nodes$CoreCompiler.visit(Nodes.java: >> 47) >>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>> at >>> sun.reflect.NativeMethodAccessorImpl.invoke( >> NativeMethodAccessorImpl.java:57) >>> at >>> sun.reflect.DelegatingMethodAccessorImpl.invoke( >> DelegatingMethodAccessorImpl.java:43) >>> at java.lang.reflect.Method.invoke(Method.java:606) >>> at >>> org.apache.calcite.util.ReflectUtil.invokeVisitorInternal( >> ReflectUtil.java:257) >>> at org.apache.calcite.util.ReflectUtil.invokeVisitor( >> ReflectUtil.java:214) >>> at >>> org.apache.calcite.util.ReflectUtil$1.invokeVisitor( >> ReflectUtil.java:471) >>> at >>> org.apache.calcite.interpreter.Interpreter$Compiler.visit(Interpreter. >> java:476) >>> at >>> org.apache.calcite.interpreter.Interpreter$Compiler.visitRoot( >> Interpreter.java:433) >>> at org.apache.calcite.interpreter.Interpreter.<init> >> (Interpreter.java:75) >>> 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:289) >>> at >>> org.apache.calcite.jdbc.CalciteMetaImpl._createIterable( >> CalciteMetaImpl.java:553) >>> at >>> org.apache.calcite.jdbc.CalciteMetaImpl.createIterable( >> CalciteMetaImpl.java:544) >>> at >>> org.apache.calcite.avatica.AvaticaResultSet.execute( >> AvaticaResultSet.java:187) >>> at >>> org.apache.calcite.jdbc.CalciteResultSet.execute( >> CalciteResultSet.java:77) >>> at >>> org.apache.calcite.jdbc.CalciteResultSet.execute( >> CalciteResultSet.java:49) >>> at >>> org.apache.calcite.avatica.AvaticaConnection$1.execute( >> AvaticaConnection.java:605) >>> at >>> org.apache.calcite.jdbc.CalciteMetaImpl.prepareAndExecute( >> CalciteMetaImpl.java:599) >>> at >>> org.apache.calcite.avatica.AvaticaConnection.prepareAndExecuteInternal( >> AvaticaConnection.java:613) >>> at >>> org.apache.calcite.avatica.AvaticaStatement.executeInternal( >> AvaticaStatement.java:139) >>> ... 7 more >>> Process finished with exit code 1 >> >> >> It seemed as a bug of Calcite? I'd appreciate if someone could give me a >> hand? >> > > > > -- > ~~~~~~~~~~~~~~~ > no mistakes > ~~~~~~~~~~~~~~~~~~
