Hi again, I have re-checked more carefully, the issue has indeed been fixed, sorry about that.
On 14 February 2018 at 23:14, Alessandro Solimando < [email protected]> wrote: > Hi Julian, > I exclude that because in that branch I have got the two mentioned in the > JIRA ticket (+ ~28 new tests) passing, and this one failing. > > Also the exception is different, in the ticket it was an assertion on the > plan/resultset failing, while in this new case it is the code compilation > module. > > I think I should open file a JIRA ticket if you agree. > > On 14 February 2018 at 20:27, Julian Hyde <[email protected]> wrote: > >> https://issues.apache.org/jira/browse/CALCITE-2075 < >> https://issues.apache.org/jira/browse/CALCITE-2075> was recently fixed. >> Is this a duplicate? >> >> >> > On Feb 13, 2018, at 1:29 PM, Alessandro Solimando < >> [email protected]> wrote: >> > >> > Hello, >> > the exception in the object is raised when the following query is >> issued to >> > Calcite: >> > >> > *select x* >> > >> > >> >> >> >> >> >> >> >> >> >> *from (values (1, 'a'), (2, 'b')) as t(x, y)where x > 1 unionselect >> xfrom >> >> (values (1, 'a'), (2, 'b'), (1, 'b'), (2, 'c'), (2, 'c')) as t(x, >> y)where x >> >>> 1* >> > >> > >> > I found several issues involving code compilation but none of them >> seemed >> > relevant for this case. >> > >> > The query looks fine to me, can you please check whether this it is an >> > issue? >> > >> > You can check it here by launching *testUnionWithFiltersProject() >> *method in >> > *SparkAdapterTest.java*: >> > https://github.com/asolimando/calcite/tree/SPARK-TESTS >> > >> > Full stack trace below: >> > >> > java.lang.RuntimeException: With materializationsEnabled=false, limit=0 >> > at org.apache.calcite.test.CalciteAssert.assertQuery(CalciteAss >> ert.java:600) >> > at >> > org.apache.calcite.test.CalciteAssert$AssertQuery.returns( >> CalciteAssert.java:1346) >> > at >> > org.apache.calcite.test.CalciteAssert$AssertQuery.returns( >> CalciteAssert.java:1329) >> > at >> > org.apache.calcite.test.CalciteAssert$AssertQuery.returnsUno >> rdered(CalciteAssert.java:1357) >> > at >> > org.apache.calcite.test.SparkAdapterTest.commonTester(SparkA >> dapterTest.java:93) >> > at >> > org.apache.calcite.test.SparkAdapterTest.testUnionWithFilter >> sProject(SparkAdapterTest.java:651) >> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> > at >> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce >> ssorImpl.java:62) >> > at >> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe >> thodAccessorImpl.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(Refl >> ectiveCallable.java:12) >> > at >> > org.junit.runners.model.FrameworkMethod.invokeExplosively(Fr >> ameworkMethod.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(BlockJUnit >> 4ClassRunner.java:78) >> > at >> > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit >> 4ClassRunner.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.runners.ParentRunner.run(ParentRunner.java:363) >> > at org.junit.runner.JUnitCore.run(JUnitCore.java:137) >> > at >> > com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs >> (JUnit4IdeaTestRunner.java:68) >> > at >> > com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.star >> tRunnerWithArgs(IdeaTestRunner.java:47) >> > at >> > com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsA >> ndStart(JUnitStarter.java:242) >> > at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStart >> er.java:70) >> > Caused by: java.sql.SQLException: Error while executing SQL "select x >> > from (values (1, 'a'), (2, 'b')) as t(x, y) >> > where x > 1 >> > union >> > select x >> > from (values (1, 'a'), (2, 'b'), (1, 'b'), (2, 'c'), (2, 'c')) as t(x, >> y) >> > where x > 1 >> > ": Error while compiling generated Java code: >> > public static class Record2_0 implements java.io.Serializable { >> > public int X; >> > public String Y; >> > public Record2_0() {} >> > public boolean equals(Object o) { >> > if (this == o) { >> > return true; >> > } >> > if (!(o instanceof Record2_0)) { >> > return false; >> > } >> > return this.X == ((Record2_0) o).X && java.util.Objects.equals(this. >> Y, >> > ((Record2_0) o).Y); >> > } >> > public int hashCode() { >> > int h = 0; >> > h = org.apache.calcite.runtime.Utilities.hash(h, this.X); >> > h = org.apache.calcite.runtime.Utilities.hash(h, this.Y); >> > return h; >> > } >> > public int compareTo(Record2_0 that) { >> > int c; >> > c = org.apache.calcite.runtime.Utilities.compare(this.X, that.X); >> > if (c != 0) { >> > return c; >> > } >> > c = org.apache.calcite.runtime.Utilities.compare(this.Y, that.Y); >> > if (c != 0) { >> > return c; >> > } >> > return 0; >> > } >> > public String toString() { >> > return "{X=" + this.X + ", Y=" + this.Y + "}"; >> > } >> > } >> > org.apache.calcite.DataContext root; >> > public org.apache.calcite.linq4j.Enumerable bind(final >> > org.apache.calcite.DataContext root0) { >> > root = root0; >> > final org.apache.calcite.linq4j.Enumerable _inputEnumerable = >> > org.apache.calcite.linq4j.Linq4j.asEnumerable(new Object[] { >> > new Object[] { >> > 1, >> > "a"}, >> > new Object[] { >> > 2, >> > "b"}}); >> > final org.apache.calcite.linq4j.AbstractEnumerable child0 = new >> > org.apache.calcite.linq4j.AbstractEnumerable(){ >> > public org.apache.calcite.linq4j.Enumerator enumerator() { >> > return new org.apache.calcite.linq4j.Enumerator(){ >> > public final org.apache.calcite.linq4j.Enumerator >> inputEnumerator >> > = _inputEnumerable.enumerator(); >> > public void reset() { >> > inputEnumerator.reset(); >> > } >> > public boolean moveNext() { >> > while (inputEnumerator.moveNext()) { >> > if (org.apache.calcite.runtime.Sq >> lFunctions.toInt(((Object[]) >> > inputEnumerator.current())[0]) > 1) { >> > return true; >> > } >> > } >> > return false; >> > } >> > public void close() { >> > inputEnumerator.close(); >> > } >> > public Object current() { >> > return >> > org.apache.calcite.runtime.SqlFunctions.toInt(((Object[]) >> > inputEnumerator.current())[0]); >> > } >> > }; >> > } >> > }; >> > final org.apache.calcite.linq4j.Enumerable _inputEnumerable0 = >> > org.apache.calcite.linq4j.Linq4j.asEnumerable(new Record2_0[] { >> > new Record2_0( >> > 1, >> > "a"), >> > new Record2_0( >> > 2, >> > "b"), >> > new Record2_0( >> > 1, >> > "b"), >> > new Record2_0( >> > 2, >> > "c"), >> > new Record2_0( >> > 2, >> > "c")}); >> > final org.apache.calcite.linq4j.AbstractEnumerable child1 = new >> > org.apache.calcite.linq4j.AbstractEnumerable(){ >> > public org.apache.calcite.linq4j.Enumerator enumerator() { >> > return new org.apache.calcite.linq4j.Enumerator(){ >> > public final org.apache.calcite.linq4j.Enumerator >> inputEnumerator >> > = _inputEnumerable0.enumerator(); >> > public void reset() { >> > inputEnumerator.reset(); >> > } >> > public boolean moveNext() { >> > while (inputEnumerator.moveNext()) { >> > if (((Record2_0) inputEnumerator.current()).X > 1) { >> > return true; >> > } >> > } >> > return false; >> > } >> > public void close() { >> > inputEnumerator.close(); >> > } >> > public Object current() { >> > return ((Record2_0) inputEnumerator.current()).X; >> > } >> > }; >> > } >> > }; >> > return child0.union(child1); >> > } >> > >> > public Class getElementType() { >> > return int.class; >> > } >> > >> > >> > 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(Ava >> ticaStatement.java:218) >> > at org.apache.calcite.test.CalciteAssert.assertQuery(CalciteAss >> ert.java:568) >> > ... 27 more >> > Caused by: java.lang.RuntimeException: Error while compiling generated >> Java >> > code: >> > public static class Record2_0 implements java.io.Serializable { >> > public int X; >> > public String Y; >> > public Record2_0() {} >> > public boolean equals(Object o) { >> > if (this == o) { >> > return true; >> > } >> > if (!(o instanceof Record2_0)) { >> > return false; >> > } >> > return this.X == ((Record2_0) o).X && java.util.Objects.equals(this. >> Y, >> > ((Record2_0) o).Y); >> > } >> > public int hashCode() { >> > int h = 0; >> > h = org.apache.calcite.runtime.Utilities.hash(h, this.X); >> > h = org.apache.calcite.runtime.Utilities.hash(h, this.Y); >> > return h; >> > } >> > public int compareTo(Record2_0 that) { >> > int c; >> > c = org.apache.calcite.runtime.Utilities.compare(this.X, that.X); >> > if (c != 0) { >> > return c; >> > } >> > c = org.apache.calcite.runtime.Utilities.compare(this.Y, that.Y); >> > if (c != 0) { >> > return c; >> > } >> > return 0; >> > } >> > public String toString() { >> > return "{X=" + this.X + ", Y=" + this.Y + "}"; >> > } >> > } >> > org.apache.calcite.DataContext root; >> > public org.apache.calcite.linq4j.Enumerable bind(final >> > org.apache.calcite.DataContext root0) { >> > root = root0; >> > final org.apache.calcite.linq4j.Enumerable _inputEnumerable = >> > org.apache.calcite.linq4j.Linq4j.asEnumerable(new Object[] { >> > new Object[] { >> > 1, >> > "a"}, >> > new Object[] { >> > 2, >> > "b"}}); >> > final org.apache.calcite.linq4j.AbstractEnumerable child0 = new >> > org.apache.calcite.linq4j.AbstractEnumerable(){ >> > public org.apache.calcite.linq4j.Enumerator enumerator() { >> > return new org.apache.calcite.linq4j.Enumerator(){ >> > public final org.apache.calcite.linq4j.Enumerator >> inputEnumerator >> > = _inputEnumerable.enumerator(); >> > public void reset() { >> > inputEnumerator.reset(); >> > } >> > public boolean moveNext() { >> > while (inputEnumerator.moveNext()) { >> > if (org.apache.calcite.runtime.Sq >> lFunctions.toInt(((Object[]) >> > inputEnumerator.current())[0]) > 1) { >> > return true; >> > } >> > } >> > return false; >> > } >> > public void close() { >> > inputEnumerator.close(); >> > } >> > public Object current() { >> > return >> > org.apache.calcite.runtime.SqlFunctions.toInt(((Object[]) >> > inputEnumerator.current())[0]); >> > } >> > }; >> > } >> > }; >> > final org.apache.calcite.linq4j.Enumerable _inputEnumerable0 = >> > org.apache.calcite.linq4j.Linq4j.asEnumerable(new Record2_0[] { >> > new Record2_0( >> > 1, >> > "a"), >> > new Record2_0( >> > 2, >> > "b"), >> > new Record2_0( >> > 1, >> > "b"), >> > new Record2_0( >> > 2, >> > "c"), >> > new Record2_0( >> > 2, >> > "c")}); >> > final org.apache.calcite.linq4j.AbstractEnumerable child1 = new >> > org.apache.calcite.linq4j.AbstractEnumerable(){ >> > public org.apache.calcite.linq4j.Enumerator enumerator() { >> > return new org.apache.calcite.linq4j.Enumerator(){ >> > public final org.apache.calcite.linq4j.Enumerator >> inputEnumerator >> > = _inputEnumerable0.enumerator(); >> > public void reset() { >> > inputEnumerator.reset(); >> > } >> > public boolean moveNext() { >> > while (inputEnumerator.moveNext()) { >> > if (((Record2_0) inputEnumerator.current()).X > 1) { >> > return true; >> > } >> > } >> > return false; >> > } >> > public void close() { >> > inputEnumerator.close(); >> > } >> > public Object current() { >> > return ((Record2_0) inputEnumerator.current()).X; >> > } >> > }; >> > } >> > }; >> > return child0.union(child1); >> > } >> > >> > public Class getElementType() { >> > return int.class; >> > } >> > >> > >> > at org.apache.calcite.avatica.Helper.wrap(Helper.java:37) >> > at >> > org.apache.calcite.adapter.enumerable.EnumerableInterpretabl >> e.toBindable(EnumerableInterpretable.java:108) >> > at >> > org.apache.calcite.prepare.CalcitePrepareImpl$CalcitePrepari >> ngStmt.implement(CalcitePrepareImpl.java:1254) >> > at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:331) >> > at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:230) >> > at >> > org.apache.calcite.prepare.CalcitePrepareImpl.prepare2_(Calc >> itePrepareImpl.java:781) >> > at >> > org.apache.calcite.prepare.CalcitePrepareImpl.prepare_(Calci >> tePrepareImpl.java:640) >> > at >> > org.apache.calcite.prepare.CalcitePrepareImpl.prepareSql(Cal >> citePrepareImpl.java:610) >> > at >> > org.apache.calcite.jdbc.CalciteConnectionImpl.parseQuery(Cal >> citeConnectionImpl.java:221) >> > at >> > org.apache.calcite.jdbc.CalciteMetaImpl.prepareAndExecute(Ca >> lciteMetaImpl.java:603) >> > at >> > org.apache.calcite.avatica.AvaticaConnection.prepareAndExecu >> teInternal(AvaticaConnection.java:638) >> > at >> > org.apache.calcite.avatica.AvaticaStatement.executeInternal( >> AvaticaStatement.java:149) >> > ... 29 more >> > Caused by: java.lang.RuntimeException: while compiling >> CalciteProgram211242 >> > at >> > org.apache.calcite.util.javac.JaninoCompiler.compile(JaninoC >> ompiler.java:83) >> > at >> > org.apache.calcite.adapter.spark.SparkHandlerImpl.compile( >> SparkHandlerImpl.java:128) >> > at >> > org.apache.calcite.adapter.enumerable.EnumerableInterpretabl >> e.toBindable(EnumerableInterpretable.java:103) >> > ... 39 more >> > Caused by: java.lang.ClassNotFoundException: File >> > 'CalciteProgram211242.java', Line 84, Column 8: No applicable >> > constructor/method found for actual parameters "int, java.lang.String"; >> > candidates are: "CalciteProgram211242$Record2_0()" >> > at >> > org.codehaus.janino.JavaSourceClassLoader.generateBytecodes( >> JavaSourceClassLoader.java:226) >> > at >> > org.apache.calcite.util.javac.JaninoCompiler$AccountingClass >> Loader.generateBytecodes(JaninoCompiler.java:160) >> > at >> > org.codehaus.janino.JavaSourceClassLoader.findClass(JavaSour >> ceClassLoader.java:178) >> > at java.lang.ClassLoader.loadClass(ClassLoader.java:424) >> > at java.lang.ClassLoader.loadClass(ClassLoader.java:357) >> > at >> > org.apache.calcite.util.javac.JaninoCompiler.compile(JaninoC >> ompiler.java:81) >> > ... 41 more >> > Caused by: org.codehaus.commons.compiler.CompileException: File >> > 'CalciteProgram211242.java', Line 84, Column 8: No applicable >> > constructor/method found for actual parameters "int, java.lang.String"; >> > candidates are: "CalciteProgram211242$Record2_0()" >> > at org.codehaus.janino.UnitCompiler.compileError(UnitCompiler. >> java:10092) >> > at >> > org.codehaus.janino.UnitCompiler.findMostSpecificIInvocable( >> UnitCompiler.java:7506) >> > at >> > org.codehaus.janino.UnitCompiler.invokeConstructor(UnitCompi >> ler.java:6452) >> > at org.codehaus.janino.UnitCompiler.compileGet2(UnitCompiler.java:4103) >> > at org.codehaus.janino.UnitCompiler.access$7600(UnitCompiler.java:183) >> > at >> > org.codehaus.janino.UnitCompiler$10.visitNewClassInstance(Un >> itCompiler.java:3263) >> > at org.codehaus.janino.Java$NewClassInstance.accept(Java.java:4085) >> > at org.codehaus.janino.UnitCompiler.compileGet(UnitCompiler.java:3278) >> > at org.codehaus.janino.UnitCompiler.compileGetValue(UnitCompile >> r.java:4345) >> > at org.codehaus.janino.UnitCompiler.compileGetValue(UnitCompile >> r.java:4303) >> > at org.codehaus.janino.UnitCompiler.compileGet2(UnitCompiler.java:4279) >> > at org.codehaus.janino.UnitCompiler.access$7500(UnitCompiler.java:183) >> > at >> > org.codehaus.janino.UnitCompiler$10.visitNewInitializedArray >> (UnitCompiler.java:3262) >> > at org.codehaus.janino.Java$NewInitializedArray.accept(Java.java:4263) >> > at org.codehaus.janino.UnitCompiler.compileGet(UnitCompiler.java:3278) >> > at org.codehaus.janino.UnitCompiler.compileGetValue(UnitCompile >> r.java:4345) >> > at org.codehaus.janino.UnitCompiler.compileGet2(UnitCompiler.java:3952) >> > at org.codehaus.janino.UnitCompiler.access$6900(UnitCompiler.java:183) >> > at >> > org.codehaus.janino.UnitCompiler$10.visitMethodInvocation(Un >> itCompiler.java:3251) >> > at org.codehaus.janino.Java$MethodInvocation.accept(Java.java:3974) >> > at org.codehaus.janino.UnitCompiler.compileGet(UnitCompiler.java:3278) >> > at org.codehaus.janino.UnitCompiler.compileGetValue(UnitCompile >> r.java:4345) >> > at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:1835) >> > at org.codehaus.janino.UnitCompiler.access$2000(UnitCompiler.java:183) >> > at >> > org.codehaus.janino.UnitCompiler$4.visitLocalVariableDeclara >> tionStatement(UnitCompiler.java:943) >> > at >> > org.codehaus.janino.Java$LocalVariableDeclarationStatement. >> accept(Java.java:2508) >> > at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:956) >> > at org.codehaus.janino.UnitCompiler.compileStatements(UnitCompi >> ler.java:997) >> > at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:2283) >> > at >> > org.codehaus.janino.UnitCompiler.compileDeclaredMethods(Unit >> Compiler.java:820) >> > at >> > org.codehaus.janino.UnitCompiler.compileDeclaredMethods(Unit >> Compiler.java:792) >> > at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:505) >> > at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:391) >> > at org.codehaus.janino.UnitCompiler.access$400(UnitCompiler.java:183) >> > at >> > org.codehaus.janino.UnitCompiler$2.visitPackageMemberClassDe >> claration(UnitCompiler.java:345) >> > at >> > org.codehaus.janino.Java$PackageMemberClassDeclaration.accep >> t(Java.java:1139) >> > at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:352) >> > at org.codehaus.janino.UnitCompiler.compileUnit(UnitCompiler.java:320) >> > at >> > org.codehaus.janino.JavaSourceClassLoader.generateBytecodes( >> JavaSourceClassLoader.java:224) >> > ... 46 more >> > java.lang.RuntimeException: exception while executing [select x >> > from (values (1, 'a'), (2, 'b')) as t(x, y) >> > where x > 1 >> > union >> > select x >> > from (values (1, 'a'), (2, 'b'), (1, 'b'), (2, 'c'), (2, 'c')) as t(x, >> y) >> > where x > 1 >> > ] >> > at >> > org.apache.calcite.test.CalciteAssert$AssertQuery.returns( >> CalciteAssert.java:1351) >> > at >> > org.apache.calcite.test.CalciteAssert$AssertQuery.returns( >> CalciteAssert.java:1329) >> > at >> > org.apache.calcite.test.CalciteAssert$AssertQuery.returnsUno >> rdered(CalciteAssert.java:1357) >> > at >> > org.apache.calcite.test.SparkAdapterTest.commonTester(SparkA >> dapterTest.java:93) >> > at >> > org.apache.calcite.test.SparkAdapterTest.testUnionWithFilter >> sProject(SparkAdapterTest.java:651) >> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> > at >> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce >> ssorImpl.java:62) >> > at >> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe >> thodAccessorImpl.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(Refl >> ectiveCallable.java:12) >> > at >> > org.junit.runners.model.FrameworkMethod.invokeExplosively(Fr >> ameworkMethod.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(BlockJUnit >> 4ClassRunner.java:78) >> > at >> > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit >> 4ClassRunner.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.runners.ParentRunner.run(ParentRunner.java:363) >> > at org.junit.runner.JUnitCore.run(JUnitCore.java:137) >> > at >> > com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs >> (JUnit4IdeaTestRunner.java:68) >> > at >> > com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.star >> tRunnerWithArgs(IdeaTestRunner.java:47) >> > at >> > com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsA >> ndStart(JUnitStarter.java:242) >> > at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStart >> er.java:70) >> > Caused by: java.lang.RuntimeException: With >> materializationsEnabled=false, >> > limit=0 >> > at org.apache.calcite.test.CalciteAssert.assertQuery(CalciteAss >> ert.java:600) >> > at >> > org.apache.calcite.test.CalciteAssert$AssertQuery.returns( >> CalciteAssert.java:1346) >> > ... 26 more >> > Caused by: java.sql.SQLException: Error while executing SQL "select x >> > from (values (1, 'a'), (2, 'b')) as t(x, y) >> > where x > 1 >> > union >> > select x >> > from (values (1, 'a'), (2, 'b'), (1, 'b'), (2, 'c'), (2, 'c')) as t(x, >> y) >> > where x > 1 >> > ": Error while compiling generated Java code: >> > public static class Record2_0 implements java.io.Serializable { >> > public int X; >> > public String Y; >> > public Record2_0() {} >> > public boolean equals(Object o) { >> > if (this == o) { >> > return true; >> > } >> > if (!(o instanceof Record2_0)) { >> > return false; >> > } >> > return this.X == ((Record2_0) o).X && java.util.Objects.equals(this. >> Y, >> > ((Record2_0) o).Y); >> > } >> > public int hashCode() { >> > int h = 0; >> > h = org.apache.calcite.runtime.Utilities.hash(h, this.X); >> > h = org.apache.calcite.runtime.Utilities.hash(h, this.Y); >> > return h; >> > } >> > public int compareTo(Record2_0 that) { >> > int c; >> > c = org.apache.calcite.runtime.Utilities.compare(this.X, that.X); >> > if (c != 0) { >> > return c; >> > } >> > c = org.apache.calcite.runtime.Utilities.compare(this.Y, that.Y); >> > if (c != 0) { >> > return c; >> > } >> > return 0; >> > } >> > public String toString() { >> > return "{X=" + this.X + ", Y=" + this.Y + "}"; >> > } >> > } >> > org.apache.calcite.DataContext root; >> > public org.apache.calcite.linq4j.Enumerable bind(final >> > org.apache.calcite.DataContext root0) { >> > root = root0; >> > final org.apache.calcite.linq4j.Enumerable _inputEnumerable = >> > org.apache.calcite.linq4j.Linq4j.asEnumerable(new Object[] { >> > new Object[] { >> > 1, >> > "a"}, >> > new Object[] { >> > 2, >> > "b"}}); >> > final org.apache.calcite.linq4j.AbstractEnumerable child0 = new >> > org.apache.calcite.linq4j.AbstractEnumerable(){ >> > public org.apache.calcite.linq4j.Enumerator enumerator() { >> > return new org.apache.calcite.linq4j.Enumerator(){ >> > public final org.apache.calcite.linq4j.Enumerator >> inputEnumerator >> > = _inputEnumerable.enumerator(); >> > public void reset() { >> > inputEnumerator.reset(); >> > } >> > public boolean moveNext() { >> > while (inputEnumerator.moveNext()) { >> > if (org.apache.calcite.runtime.Sq >> lFunctions.toInt(((Object[]) >> > inputEnumerator.current())[0]) > 1) { >> > return true; >> > } >> > } >> > return false; >> > } >> > public void close() { >> > inputEnumerator.close(); >> > } >> > public Object current() { >> > return >> > org.apache.calcite.runtime.SqlFunctions.toInt(((Object[]) >> > inputEnumerator.current())[0]); >> > } >> > }; >> > } >> > }; >> > final org.apache.calcite.linq4j.Enumerable _inputEnumerable0 = >> > org.apache.calcite.linq4j.Linq4j.asEnumerable(new Record2_0[] { >> > new Record2_0( >> > 1, >> > "a"), >> > new Record2_0( >> > 2, >> > "b"), >> > new Record2_0( >> > 1, >> > "b"), >> > new Record2_0( >> > 2, >> > "c"), >> > new Record2_0( >> > 2, >> > "c")}); >> > final org.apache.calcite.linq4j.AbstractEnumerable child1 = new >> > org.apache.calcite.linq4j.AbstractEnumerable(){ >> > public org.apache.calcite.linq4j.Enumerator enumerator() { >> > return new org.apache.calcite.linq4j.Enumerator(){ >> > public final org.apache.calcite.linq4j.Enumerator >> inputEnumerator >> > = _inputEnumerable0.enumerator(); >> > public void reset() { >> > inputEnumerator.reset(); >> > } >> > public boolean moveNext() { >> > while (inputEnumerator.moveNext()) { >> > if (((Record2_0) inputEnumerator.current()).X > 1) { >> > return true; >> > } >> > } >> > return false; >> > } >> > public void close() { >> > inputEnumerator.close(); >> > } >> > public Object current() { >> > return ((Record2_0) inputEnumerator.current()).X; >> > } >> > }; >> > } >> > }; >> > return child0.union(child1); >> > } >> > >> > public Class getElementType() { >> > return int.class; >> > } >> > >> > >> > 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(Ava >> ticaStatement.java:218) >> > at org.apache.calcite.test.CalciteAssert.assertQuery(CalciteAss >> ert.java:568) >> > ... 27 more >> > Caused by: java.lang.RuntimeException: Error while compiling generated >> Java >> > code: >> > public static class Record2_0 implements java.io.Serializable { >> > public int X; >> > public String Y; >> > public Record2_0() {} >> > public boolean equals(Object o) { >> > if (this == o) { >> > return true; >> > } >> > if (!(o instanceof Record2_0)) { >> > return false; >> > } >> > return this.X == ((Record2_0) o).X && java.util.Objects.equals(this. >> Y, >> > ((Record2_0) o).Y); >> > } >> > public int hashCode() { >> > int h = 0; >> > h = org.apache.calcite.runtime.Utilities.hash(h, this.X); >> > h = org.apache.calcite.runtime.Utilities.hash(h, this.Y); >> > return h; >> > } >> > public int compareTo(Record2_0 that) { >> > int c; >> > c = org.apache.calcite.runtime.Utilities.compare(this.X, that.X); >> > if (c != 0) { >> > return c; >> > } >> > c = org.apache.calcite.runtime.Utilities.compare(this.Y, that.Y); >> > if (c != 0) { >> > return c; >> > } >> > return 0; >> > } >> > public String toString() { >> > return "{X=" + this.X + ", Y=" + this.Y + "}"; >> > } >> > } >> > org.apache.calcite.DataContext root; >> > public org.apache.calcite.linq4j.Enumerable bind(final >> > org.apache.calcite.DataContext root0) { >> > root = root0; >> > final org.apache.calcite.linq4j.Enumerable _inputEnumerable = >> > org.apache.calcite.linq4j.Linq4j.asEnumerable(new Object[] { >> > new Object[] { >> > 1, >> > "a"}, >> > new Object[] { >> > 2, >> > "b"}}); >> > final org.apache.calcite.linq4j.AbstractEnumerable child0 = new >> > org.apache.calcite.linq4j.AbstractEnumerable(){ >> > public org.apache.calcite.linq4j.Enumerator enumerator() { >> > return new org.apache.calcite.linq4j.Enumerator(){ >> > public final org.apache.calcite.linq4j.Enumerator >> inputEnumerator >> > = _inputEnumerable.enumerator(); >> > public void reset() { >> > inputEnumerator.reset(); >> > } >> > public boolean moveNext() { >> > while (inputEnumerator.moveNext()) { >> > if (org.apache.calcite.runtime.Sq >> lFunctions.toInt(((Object[]) >> > inputEnumerator.current())[0]) > 1) { >> > return true; >> > } >> > } >> > return false; >> > } >> > public void close() { >> > inputEnumerator.close(); >> > } >> > public Object current() { >> > return >> > org.apache.calcite.runtime.SqlFunctions.toInt(((Object[]) >> > inputEnumerator.current())[0]); >> > } >> > }; >> > } >> > }; >> > final org.apache.calcite.linq4j.Enumerable _inputEnumerable0 = >> > org.apache.calcite.linq4j.Linq4j.asEnumerable(new Record2_0[] { >> > new Record2_0( >> > 1, >> > "a"), >> > new Record2_0( >> > 2, >> > "b"), >> > new Record2_0( >> > 1, >> > "b"), >> > new Record2_0( >> > 2, >> > "c"), >> > new Record2_0( >> > 2, >> > "c")}); >> > final org.apache.calcite.linq4j.AbstractEnumerable child1 = new >> > org.apache.calcite.linq4j.AbstractEnumerable(){ >> > public org.apache.calcite.linq4j.Enumerator enumerator() { >> > return new org.apache.calcite.linq4j.Enumerator(){ >> > public final org.apache.calcite.linq4j.Enumerator >> inputEnumerator >> > = _inputEnumerable0.enumerator(); >> > public void reset() { >> > inputEnumerator.reset(); >> > } >> > public boolean moveNext() { >> > while (inputEnumerator.moveNext()) { >> > if (((Record2_0) inputEnumerator.current()).X > 1) { >> > return true; >> > } >> > } >> > return false; >> > } >> > public void close() { >> > inputEnumerator.close(); >> > } >> > public Object current() { >> > return ((Record2_0) inputEnumerator.current()).X; >> > } >> > }; >> > } >> > }; >> > return child0.union(child1); >> > } >> > >> > public Class getElementType() { >> > return int.class; >> > } >> > >> > >> > at org.apache.calcite.avatica.Helper.wrap(Helper.java:37) >> > at >> > org.apache.calcite.adapter.enumerable.EnumerableInterpretabl >> e.toBindable(EnumerableInterpretable.java:108) >> > at >> > org.apache.calcite.prepare.CalcitePrepareImpl$CalcitePrepari >> ngStmt.implement(CalcitePrepareImpl.java:1254) >> > at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:331) >> > at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:230) >> > at >> > org.apache.calcite.prepare.CalcitePrepareImpl.prepare2_(Calc >> itePrepareImpl.java:781) >> > at >> > org.apache.calcite.prepare.CalcitePrepareImpl.prepare_(Calci >> tePrepareImpl.java:640) >> > at >> > org.apache.calcite.prepare.CalcitePrepareImpl.prepareSql(Cal >> citePrepareImpl.java:610) >> > at >> > org.apache.calcite.jdbc.CalciteConnectionImpl.parseQuery(Cal >> citeConnectionImpl.java:221) >> > at >> > org.apache.calcite.jdbc.CalciteMetaImpl.prepareAndExecute(Ca >> lciteMetaImpl.java:603) >> > at >> > org.apache.calcite.avatica.AvaticaConnection.prepareAndExecu >> teInternal(AvaticaConnection.java:638) >> > at >> > org.apache.calcite.avatica.AvaticaStatement.executeInternal( >> AvaticaStatement.java:149) >> > ... 29 more >> > Caused by: java.lang.RuntimeException: while compiling >> CalciteProgram211242 >> > at >> > org.apache.calcite.util.javac.JaninoCompiler.compile(JaninoC >> ompiler.java:83) >> > at >> > org.apache.calcite.adapter.spark.SparkHandlerImpl.compile( >> SparkHandlerImpl.java:128) >> > at >> > org.apache.calcite.adapter.enumerable.EnumerableInterpretabl >> e.toBindable(EnumerableInterpretable.java:103) >> > ... 39 more >> > Caused by: java.lang.ClassNotFoundException: File >> > 'CalciteProgram211242.java', Line 84, Column 8: No applicable >> > constructor/method found for actual parameters "int, java.lang.String"; >> > candidates are: "CalciteProgram211242$Record2_0()" >> > at >> > org.codehaus.janino.JavaSourceClassLoader.generateBytecodes( >> JavaSourceClassLoader.java:226) >> > at >> > org.apache.calcite.util.javac.JaninoCompiler$AccountingClass >> Loader.generateBytecodes(JaninoCompiler.java:160) >> > at >> > org.codehaus.janino.JavaSourceClassLoader.findClass(JavaSour >> ceClassLoader.java:178) >> > at java.lang.ClassLoader.loadClass(ClassLoader.java:424) >> > at java.lang.ClassLoader.loadClass(ClassLoader.java:357) >> > at >> > org.apache.calcite.util.javac.JaninoCompiler.compile(JaninoC >> ompiler.java:81) >> > ... 41 more >> > Caused by: org.codehaus.commons.compiler.CompileException: File >> > 'CalciteProgram211242.java', Line 84, Column 8: No applicable >> > constructor/method found for actual parameters "int, java.lang.String"; >> > candidates are: "CalciteProgram211242$Record2_0()" >> > at org.codehaus.janino.UnitCompiler.compileError(UnitCompiler. >> java:10092) >> > at >> > org.codehaus.janino.UnitCompiler.findMostSpecificIInvocable( >> UnitCompiler.java:7506) >> > at >> > org.codehaus.janino.UnitCompiler.invokeConstructor(UnitCompi >> ler.java:6452) >> > at org.codehaus.janino.UnitCompiler.compileGet2(UnitCompiler.java:4103) >> > at org.codehaus.janino.UnitCompiler.access$7600(UnitCompiler.java:183) >> > at >> > org.codehaus.janino.UnitCompiler$10.visitNewClassInstance(Un >> itCompiler.java:3263) >> > at org.codehaus.janino.Java$NewClassInstance.accept(Java.java:4085) >> > at org.codehaus.janino.UnitCompiler.compileGet(UnitCompiler.java:3278) >> > at org.codehaus.janino.UnitCompiler.compileGetValue(UnitCompile >> r.java:4345) >> > at org.codehaus.janino.UnitCompiler.compileGetValue(UnitCompile >> r.java:4303) >> > at org.codehaus.janino.UnitCompiler.compileGet2(UnitCompiler.java:4279) >> > at org.codehaus.janino.UnitCompiler.access$7500(UnitCompiler.java:183) >> > at >> > org.codehaus.janino.UnitCompiler$10.visitNewInitializedArray >> (UnitCompiler.java:3262) >> > at org.codehaus.janino.Java$NewInitializedArray.accept(Java.java:4263) >> > at org.codehaus.janino.UnitCompiler.compileGet(UnitCompiler.java:3278) >> > at org.codehaus.janino.UnitCompiler.compileGetValue(UnitCompile >> r.java:4345) >> > at org.codehaus.janino.UnitCompiler.compileGet2(UnitCompiler.java:3952) >> > at org.codehaus.janino.UnitCompiler.access$6900(UnitCompiler.java:183) >> > at >> > org.codehaus.janino.UnitCompiler$10.visitMethodInvocation(Un >> itCompiler.java:3251) >> > at org.codehaus.janino.Java$MethodInvocation.accept(Java.java:3974) >> > at org.codehaus.janino.UnitCompiler.compileGet(UnitCompiler.java:3278) >> > at org.codehaus.janino.UnitCompiler.compileGetValue(UnitCompile >> r.java:4345) >> > at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:1835) >> > at org.codehaus.janino.UnitCompiler.access$2000(UnitCompiler.java:183) >> > at >> > org.codehaus.janino.UnitCompiler$4.visitLocalVariableDeclara >> tionStatement(UnitCompiler.java:943) >> > at >> > org.codehaus.janino.Java$LocalVariableDeclarationStatement. >> accept(Java.java:2508) >> > at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:956) >> > at org.codehaus.janino.UnitCompiler.compileStatements(UnitCompi >> ler.java:997) >> > at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:2283) >> > at >> > org.codehaus.janino.UnitCompiler.compileDeclaredMethods(Unit >> Compiler.java:820) >> > at >> > org.codehaus.janino.UnitCompiler.compileDeclaredMethods(Unit >> Compiler.java:792) >> > at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:505) >> > at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:391) >> > at org.codehaus.janino.UnitCompiler.access$400(UnitCompiler.java:183) >> > at >> > org.codehaus.janino.UnitCompiler$2.visitPackageMemberClassDe >> claration(UnitCompiler.java:345) >> > at >> > org.codehaus.janino.Java$PackageMemberClassDeclaration.accep >> t(Java.java:1139) >> > at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:352) >> > at org.codehaus.janino.UnitCompiler.compileUnit(UnitCompiler.java:320) >> > at >> > org.codehaus.janino.JavaSourceClassLoader.generateBytecodes( >> JavaSourceClassLoader.java:224) >> > ... 46 more >> >> >
