Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
Description
When following this foodmart example, I have created the Foodmart and Hr separately with no java package and passing them to ReflectiveSchema, it threw NPE when executing executeQuery.
[error] (run-main-0) java.sql.SQLException: Error while executing SQL "select * from "hr"."emps"": null java.sql.SQLException: Error while executing SQL "select * from "hr"."emps"": 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 Main$.main(Main.scala:39) at Main.main(Main.scala) 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) Caused by: java.lang.NullPointerException at org.apache.calcite.linq4j.tree.Types.className(Types.java:256) at org.apache.calcite.linq4j.tree.ExpressionWriter.append(ExpressionWriter.java:124) at org.apache.calcite.linq4j.tree.UnaryExpression.accept(UnaryExpression.java:48) at org.apache.calcite.linq4j.tree.ExpressionWriter.requireParentheses(ExpressionWriter.java:69) at org.apache.calcite.linq4j.tree.UnaryExpression.accept(UnaryExpression.java:47) at org.apache.calcite.linq4j.tree.MemberExpression.accept(MemberExpression.java:71) at org.apache.calcite.linq4j.tree.MethodCallExpression.accept(MethodCallExpression.java:105) at org.apache.calcite.linq4j.tree.GotoStatement.accept0(GotoStatement.java:84) at org.apache.calcite.linq4j.tree.Statement.accept(Statement.java:32) at org.apache.calcite.linq4j.tree.BlockStatement.accept0(BlockStatement.java:75) at org.apache.calcite.linq4j.tree.ExpressionWriter.append(ExpressionWriter.java:129) at org.apache.calcite.linq4j.tree.MethodDeclaration.accept(MethodDeclaration.java:79) at org.apache.calcite.linq4j.tree.ExpressionWriter.write(ExpressionWriter.java:49) at org.apache.calcite.linq4j.tree.Expressions.toString(Expressions.java:55) at org.apache.calcite.adapter.enumerable.EnumerableInterpretable.toBindable(EnumerableInterpretable.java:93) at org.apache.calcite.prepare.CalcitePrepareImpl$CalcitePreparingStmt.implement(CalcitePrepareImpl.java:1257) at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:331) at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:228) at org.apache.calcite.prepare.CalcitePrepareImpl.prepare2_(CalcitePrepareImpl.java:784) at org.apache.calcite.prepare.CalcitePrepareImpl.prepare_(CalcitePrepareImpl.java:639) at org.apache.calcite.prepare.CalcitePrepareImpl.prepareSql(CalcitePrepareImpl.java:609) at org.apache.calcite.jdbc.CalciteConnectionImpl.parseQuery(CalciteConnectionImpl.java:214) at org.apache.calcite.jdbc.CalciteMetaImpl.prepareAndExecute(CalciteMetaImpl.java:603) at org.apache.calcite.avatica.AvaticaConnection.prepareAndExecuteInternal(AvaticaConnection.java:638) at org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:149) at org.apache.calcite.avatica.AvaticaStatement.executeQuery(AvaticaStatement.java:218) at Main$.main(Main.scala:39) at Main.main(Main.scala) 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) [trace] Stack trace suppressed: run last compile:run for the full output. java.lang.RuntimeException: Nonzero exit code: 1 at scala.sys.package$.error(package.scala:27) [trace] Stack trace suppressed: run last compile:run for the full output. [error] (compile:run) Nonzero exit code: 1 [error] Total time: 10 s, completed Aug 2, 2017 11:45:24 AM