substrait-io / substrait-java

Apache License 2.0
77 stars 72 forks source link

failed query q8 q12 in tpch_smoke.sh #87

Open jikunshang opened 2 years ago

jikunshang commented 2 years ago

Below is error log of q8, q12 is almost same.

Processing tpc-h query, 8
select o_year, sum(case when nation = 'EGYPT' then volume else 0 end) / sum(volume) as mkt_share from ( select extract(year from o.o_orderdate) as o_year, l.l_extendedprice 1.txt 1y.txt count.txt date.txt decimal.txt filter.txt null.txt smoke.sh str.txt tpch_smoke.sh where.txt (1 - l.l_discount) as volume, n2.n_name as nation from "part" p, "supplier" s, "lineitem" l, "orders" o, "customer" c, "nation" n1, "nation" n2, "region" r where p.p_partkey = l.l_partkey and s.s_suppkey = l.l_suppkey and l.l_orderkey = o.o_orderkey and o.o_custkey = c.c_custkey and c.c_nationkey = n1.n_nationkey and n1.n_regionkey = r.r_regionkey and r.r_name = 'MIDDLE EAST' and s.s_nationkey = n2.n_nationkey and o.o_orderdate between date '1995-01-01' and date '1996-12-31' and p.p_type = 'PROMO BRUSHED COPPER' ) as all_nations group by o_year order by o_year
Exception in thread "main" java.lang.ExceptionInInitializerError
        at org.apache.calcite.linq4j.tree.BlockBuilder.<clinit>(BlockBuilder.java:52)
        at org.apache.calcite.rex.RexExecutorImpl.compile(RexExecutorImpl.java:83)
        at org.apache.calcite.rex.RexExecutorImpl.compile(RexExecutorImpl.java:68)
        at org.apache.calcite.rex.RexExecutorImpl.reduce(RexExecutorImpl.java:132)
        at org.apache.calcite.rex.RexSimplify.simplifyCast(RexSimplify.java:2216)
        at org.apache.calcite.rex.RexSimplify.simplify(RexSimplify.java:289)
        at org.apache.calcite.rex.RexSimplify.simplifyList(RexSimplify.java:662)
        at org.apache.calcite.rex.RexSimplify.simplifyComparison(RexSimplify.java:506)
        at org.apache.calcite.rex.RexSimplify.simplifyComparison(RexSimplify.java:498)
        at org.apache.calcite.rex.RexSimplify.simplify(RexSimplify.java:307)
        at org.apache.calcite.rex.RexSimplify.simplifyCase(RexSimplify.java:1138)
        at org.apache.calcite.rex.RexSimplify.simplify(RexSimplify.java:285)
        at org.apache.calcite.rex.RexSimplify.simplifyUnknownAs(RexSimplify.java:248)
        at org.apache.calcite.rex.RexSimplify.simplifyPreservingType(RexSimplify.java:187)
        at org.apache.calcite.rex.RexSimplify.simplifyPreservingType(RexSimplify.java:182)
        at org.apache.calcite.tools.RelBuilder.project_(RelBuilder.java:1947)
        at org.apache.calcite.tools.RelBuilder.project_(RelBuilder.java:1938)
        at org.apache.calcite.tools.RelBuilder.project(RelBuilder.java:1797)
        at org.apache.calcite.tools.RelBuilder.projectNamed(RelBuilder.java:2088)
        at org.apache.calcite.sql2rel.SqlToRelConverter.createAggImpl(SqlToRelConverter.java:3289)
        at org.apache.calcite.sql2rel.SqlToRelConverter.convertAgg(SqlToRelConverter.java:3192)
        at org.apache.calcite.sql2rel.SqlToRelConverter.convertSelectImpl(SqlToRelConverter.java:738)
        at org.apache.calcite.sql2rel.SqlToRelConverter.convertSelect(SqlToRelConverter.java:664)
        at org.apache.calcite.sql2rel.SqlToRelConverter.convertQueryRecursive(SqlToRelConverter.java:3589)
        at org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery(SqlToRelConverter.java:589)
        at io.substrait.isthmus.SqlToSubstrait.lambda$sqlToRelNode$1(SqlToSubstrait.java:153)
        at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
        at java.util.AbstractList$RandomAccessSpliterator.forEachRemaining(AbstractList.java:720)
        at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
        at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575)
        at java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
        at java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616)
        at java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622)
        at java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627)
        at io.substrait.isthmus.SqlToSubstrait.sqlToRelNode(SqlToSubstrait.java:162)
        at io.substrait.isthmus.SqlToSubstrait.executeInner(SqlToSubstrait.java:112)
        at io.substrait.isthmus.SqlToSubstrait.execute(SqlToSubstrait.java:81)
        at io.substrait.isthmus.PlanEntryPoint.call(PlanEntryPoint.java:41)
        at io.substrait.isthmus.PlanEntryPoint.call(PlanEntryPoint.java:15)
        at picocli.CommandLine.executeUserObject(CommandLine.java:1953)
        at picocli.CommandLine.access$1300(CommandLine.java:145)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2352)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2346)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2311)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
        at picocli.CommandLine.execute(CommandLine.java:2078)
        at io.substrait.isthmus.PlanEntryPoint.main(PlanEntryPoint.java:49)
Caused by: java.lang.RuntimeException: Unknown field 'FALSE' in class class java.lang.Boolean
        at org.apache.calcite.linq4j.tree.Types.getField(Types.java:110)
        at org.apache.calcite.linq4j.tree.Types.getField(Types.java:121)
        at org.apache.calcite.linq4j.tree.Expressions.field(Expressions.java:849)
        at org.apache.calcite.linq4j.tree.OptimizeShuttle.<clinit>(OptimizeShuttle.java:47)
        ... 48 more
Caused by: java.lang.NoSuchFieldException: FALSE
        at java.lang.Class.getField(DynamicHub.java:1103)
        at org.apache.calcite.linq4j.tree.Types.getField(Types.java:108)
        ... 51 more
jacques-n commented 2 years ago

Probably need to add java.lang.Boolean to list of runtime registered classes.

jikunshang commented 2 years ago

I try to add register(java.lang.Boolean.class); in RegisterAtRuntime.java. This error is resolved but it raises other errors. Still reflection issues?

Exception in thread "main" java.lang.ExceptionInInitializerError
        at org.apache.calcite.adapter.enumerable.RexToLixTranslator.visitCall(RexToLixTranslator.java:1154)
        at org.apache.calcite.adapter.enumerable.RexToLixTranslator.visitCall(RexToLixTranslator.java:98)
        at org.apache.calcite.rex.RexCall.accept(RexCall.java:189)
        at org.apache.calcite.adapter.enumerable.RexToLixTranslator.visitLocalRef(RexToLixTranslator.java:1044)
        at org.apache.calcite.adapter.enumerable.RexToLixTranslator.visitLocalRef(RexToLixTranslator.java:98)
        at org.apache.calcite.rex.RexLocalRef.accept(RexLocalRef.java:77)
        at org.apache.calcite.adapter.enumerable.RexToLixTranslator.translate(RexToLixTranslator.java:255)
        at org.apache.calcite.adapter.enumerable.RexToLixTranslator.translate(RexToLixTranslator.java:249)
        at org.apache.calcite.adapter.enumerable.RexToLixTranslator.translateList(RexToLixTranslator.java:885)
        at org.apache.calcite.adapter.enumerable.RexToLixTranslator.translateProjects(RexToLixTranslator.java:207)
        at org.apache.calcite.rex.RexExecutorImpl.compile(RexExecutorImpl.java:94)
        at org.apache.calcite.rex.RexExecutorImpl.compile(RexExecutorImpl.java:68)
        at org.apache.calcite.rex.RexExecutorImpl.reduce(RexExecutorImpl.java:132)
        at org.apache.calcite.rex.RexSimplify.simplifyCast(RexSimplify.java:2216)
        at org.apache.calcite.rex.RexSimplify.simplify(RexSimplify.java:289)
        at org.apache.calcite.rex.RexSimplify.simplifyList(RexSimplify.java:662)
        at org.apache.calcite.rex.RexSimplify.simplifyComparison(RexSimplify.java:506)
        at org.apache.calcite.rex.RexSimplify.simplifyComparison(RexSimplify.java:498)
        at org.apache.calcite.rex.RexSimplify.simplify(RexSimplify.java:307)
        at org.apache.calcite.rex.RexSimplify.simplifyCase(RexSimplify.java:1138)
        at org.apache.calcite.rex.RexSimplify.simplify(RexSimplify.java:285)
        at org.apache.calcite.rex.RexSimplify.simplifyUnknownAs(RexSimplify.java:248)
        at org.apache.calcite.rex.RexSimplify.simplifyPreservingType(RexSimplify.java:187)
        at org.apache.calcite.rex.RexSimplify.simplifyPreservingType(RexSimplify.java:182)
        at org.apache.calcite.tools.RelBuilder.project_(RelBuilder.java:1947)
        at org.apache.calcite.tools.RelBuilder.project_(RelBuilder.java:1938)
        at org.apache.calcite.tools.RelBuilder.project(RelBuilder.java:1797)
        at org.apache.calcite.tools.RelBuilder.projectNamed(RelBuilder.java:2088)
        at org.apache.calcite.sql2rel.SqlToRelConverter.createAggImpl(SqlToRelConverter.java:3289)
        at org.apache.calcite.sql2rel.SqlToRelConverter.convertAgg(SqlToRelConverter.java:3192)
        at org.apache.calcite.sql2rel.SqlToRelConverter.convertSelectImpl(SqlToRelConverter.java:738)
        at org.apache.calcite.sql2rel.SqlToRelConverter.convertSelect(SqlToRelConverter.java:664)
        at org.apache.calcite.sql2rel.SqlToRelConverter.convertQueryRecursive(SqlToRelConverter.java:3589)
        at org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery(SqlToRelConverter.java:589)
        at io.substrait.isthmus.SqlToSubstrait.lambda$sqlToRelNode$1(SqlToSubstrait.java:153)
        at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
        at java.util.AbstractList$RandomAccessSpliterator.forEachRemaining(AbstractList.java:720)
        at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
        at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575)
        at java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
        at java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616)
        at java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622)
        at java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627)
        at io.substrait.isthmus.SqlToSubstrait.sqlToRelNode(SqlToSubstrait.java:162)
        at io.substrait.isthmus.SqlToSubstrait.executeInner(SqlToSubstrait.java:112)
        at io.substrait.isthmus.SqlToSubstrait.execute(SqlToSubstrait.java:81)
        at io.substrait.isthmus.PlanEntryPoint.call(PlanEntryPoint.java:41)
        at io.substrait.isthmus.PlanEntryPoint.call(PlanEntryPoint.java:15)
        at picocli.CommandLine.executeUserObject(CommandLine.java:1953)
        at picocli.CommandLine.access$1300(CommandLine.java:145)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2352)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2346)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2311)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
        at picocli.CommandLine.execute(CommandLine.java:2078)
        at io.substrait.isthmus.PlanEntryPoint.main(PlanEntryPoint.java:49)
Caused by: java.lang.IllegalArgumentException: class org.apache.calcite.adapter.enumerable.RexImpTable$CountImplementor should implement zero arguments constructor
        at org.apache.calcite.adapter.enumerable.RexImpTable.constructorSupplier(RexImpTable.java:711)
        at org.apache.calcite.adapter.enumerable.RexImpTable.<init>(RexImpTable.java:652)
        at org.apache.calcite.adapter.enumerable.RexImpTable.<clinit>(RexImpTable.java:327)
        ... 57 more