Absolutely: https://issues.apache.org/jira/browse/CALCITE-2228
Please tell me if I should modify any of the information I supplied. Like the affected version\component. Thanks, Gelbana On Wed, Mar 28, 2018 at 11:26 PM, Julian Hyde <[email protected]> wrote: > It does indeed look as if that piece of code (AggregateNode.java line 149) > has never been run. Can you please log a JIRA case? > > > On Mar 28, 2018, at 1:42 PM, Muhammad Gelbana <[email protected]> > wrote: > > > > Looking at this line > > <https://github.com/apache/calcite/blob/master/core/src/ > main/java/org/apache/calcite/interpreter/AggregateNode.java#L150>, > > and the referenced instance variable > > <https://github.com/apache/calcite/blob/master/core/src/ > main/java/org/apache/calcite/adapter/enumerable/AggImpState.java#L33>, > > it looks to me that *int stateSize = agg.state.size* will always throw a > > NPE because the *agg.state* object reference is never initialized before > > it's being used ! > > > > I'm facing the following exception > > > > java.sql.SQLException: Error while executing SQL "SELECT MAX(COUNTRY_ID), > > MAX(COUNTRY_TOTAL_ID) FROM SALES.COUNTRIES": 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:156) > > at > > org.apache.calcite.avatica.AvaticaStatement.executeQuery( > AvaticaStatement.java:218) > > at > > com.mg.sqlinterface.data.provider.calcite.internal. > Test_SQLi.testMG(Test_SQLi.java:35) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > sun.reflect.NativeMethodAccessorImpl.invoke( > NativeMethodAccessorImpl.java:62) > > at > > sun.reflect.DelegatingMethodAccessorImpl.invoke( > DelegatingMethodAccessorImpl.java:43) > > at java.lang.reflect.Method.invoke(Method.java:498) > > at > > org.junit.runners.model.FrameworkMethod$1.runReflectiveCall( > FrameworkMethod.java:50) > > at > > org.junit.internal.runners.model.ReflectiveCallable.run( > ReflectiveCallable.java:12) > > at > > org.junit.runners.model.FrameworkMethod.invokeExplosively( > FrameworkMethod.java:47) > > at > > org.junit.internal.runners.statements.InvokeMethod. > evaluate(InvokeMethod.java:17) > > at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) > > at > > org.junit.runners.BlockJUnit4ClassRunner.runChild( > BlockJUnit4ClassRunner.java:78) > > at > > org.junit.runners.BlockJUnit4ClassRunner.runChild( > BlockJUnit4ClassRunner.java:57) > > at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) > > at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) > > at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) > > at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) > > at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) > > at > > org.junit.internal.runners.statements.RunBefores. > evaluate(RunBefores.java:26) > > at > > org.junit.internal.runners.statements.RunAfters.evaluate( > RunAfters.java:27) > > at org.junit.runners.ParentRunner.run(ParentRunner.java:363) > > at > > org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run( > JUnit4TestReference.java:86) > > at > > org.eclipse.jdt.internal.junit.runner.TestExecution. > run(TestExecution.java:38) > > at > > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner. > runTests(RemoteTestRunner.java:459) > > at > > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner. > runTests(RemoteTestRunner.java:678) > > at > > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner. > run(RemoteTestRunner.java:382) > > at > > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner. > main(RemoteTestRunner.java:192) > > Caused by: *java.lang.NullPointerException* > > at org.apache.calcite.interpreter.AggregateNode.getAccumulator( > > *AggregateNode.java:150*) > > 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:62) > > at > > sun.reflect.DelegatingMethodAccessorImpl.invoke( > DelegatingMethodAccessorImpl.java:43) > > at java.lang.reflect.Method.invoke(Method.java:498) > > 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:464) > > at > > org.apache.calcite.interpreter.Interpreter$Compiler.visit(Interpreter. > java:480) > > at > > org.apache.calcite.interpreter.Interpreter$Compiler.visitRoot( > Interpreter.java:437) > > at > > org.apache.calcite.interpreter.Interpreter.<init>(Interpreter.java:78) > > at Baz.bind(Unknown Source) > > at > > org.apache.calcite.jdbc.CalcitePrepare$CalciteSignature.enumerable( > CalcitePrepare.java:365) > > at > > org.apache.calcite.jdbc.CalciteConnectionImpl.enumerable( > CalciteConnectionImpl.java:301) > > at > > org.apache.calcite.jdbc.CalciteMetaImpl._createIterable( > CalciteMetaImpl.java:559) > > at > > org.apache.calcite.jdbc.CalciteMetaImpl.createIterable( > CalciteMetaImpl.java:550) > > at > > org.apache.calcite.avatica.AvaticaResultSet.execute( > AvaticaResultSet.java:204) > > at > > org.apache.calcite.jdbc.CalciteResultSet.execute( > CalciteResultSet.java:67) > > at > > org.apache.calcite.jdbc.CalciteResultSet.execute( > CalciteResultSet.java:44) > > at > > org.apache.calcite.avatica.AvaticaConnection$1.execute( > AvaticaConnection.java:630) > > at > > org.apache.calcite.jdbc.CalciteMetaImpl.prepareAndExecute( > CalciteMetaImpl.java:619) > > at > > org.apache.calcite.avatica.AvaticaConnection.prepareAndExecuteInternal( > AvaticaConnection.java:638) > > at > > org.apache.calcite.avatica.AvaticaStatement.executeInternal( > AvaticaStatement.java:149) > > ... 27 more > > > > > > Thanks, > > Gelbana > > > >
