[ https://issues.apache.org/jira/browse/DRILL-1905?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14254560#comment-14254560 ]
Aman Sinha commented on DRILL-1905: ----------------------------------- Interestingly, this error happens only when the files are in different directories. The assertion in AbstractRelNode.getRowType() happens because the derivedRowType() of the Union is returning NULL. At first glance, it looks like leastRestrictiveSqlType() is not handling the ANY type. I will look into it. > UNION ALL of two identical json files fails with exception > ---------------------------------------------------------- > > Key: DRILL-1905 > URL: https://issues.apache.org/jira/browse/DRILL-1905 > Project: Apache Drill > Issue Type: Bug > Components: Query Planning & Optimization > Affects Versions: 0.7.0 > Reporter: Victoria Markman > > {code} git.commit.id.abbrev=e3ab2c1 {code} > {code} > 0: jdbc:drill:schema=dfs> select * from `logs/2014/02/t.json`; > +------------+------------+------------+ > | a1 | b1 | c1 | > +------------+------------+------------+ > | 0 | 0 | true | > | 0 | 0 | false | > | 0 | 0 | false | > | 1 | 1 | true | > | 1 | 1 | true | > +------------+------------+------------+ > 5 rows selected (0.099 seconds) > 0: jdbc:drill:schema=dfs> select * from `logs/2014/03/t.json`; > +------------+------------+------------+ > | a1 | b1 | c1 | > +------------+------------+------------+ > | 0 | 0 | true | > | 0 | 0 | false | > | 0 | 0 | false | > | 1 | 1 | true | > | 1 | 1 | true | > +------------+------------+------------+ > 5 rows selected (0.065 seconds) > 0: jdbc:drill:schema=dfs> select * from `logs/2014/02/t.json` union all > select * from `logs/2014/03/t.json`; > Query failed: Query failed: Unexpected exception during fragment > initialization: DrillUnionRel#1680 > Error: exception while executing query: Failure while executing query. > (state=,code=0) > 2014-12-20 01:27:01,939 [2b6b2f9a-7e4e-1670-5210-c2a8dabea33b:foreman] ERROR > o.a.drill.exec.work.foreman.Foreman - Error > 4505ba6b-a2b6-4355-aac1-1edd74bc347d: Query failed: Unexpected exception > during fragment initialization: DrillUnionRel#1680 > org.apache.drill.exec.work.foreman.ForemanException: Unexpected exception > during fragment initialization: DrillUnionRel#1680 > at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:194) > [drill-java-exec-0.7.0-r2-SNAPSHOT-rebuffed.jar:0.7.0-r2-SNAPSHOT] > at > org.apache.drill.exec.work.WorkManager$RunnableWrapper.run(WorkManager.java:254) > [drill-java-exec-0.7.0-r2-SNAPSHOT-rebuffed.jar:0.7.0-r2-SNAPSHOT] > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) > [na:1.7.0_71] > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) > [na:1.7.0_71] > at java.lang.Thread.run(Thread.java:745) [na:1.7.0_71] > Caused by: java.lang.AssertionError: DrillUnionRel#1680 > at > org.eigenbase.rel.AbstractRelNode.getRowType(AbstractRelNode.java:211) > ~[optiq-core-0.9-drill-r12.jar:na] > at > org.apache.drill.exec.planner.common.DrillUnionRelBase.isCompatible(DrillUnionRelBase.java:44) > ~[drill-java-exec-0.7.0-r2-SNAPSHOT-rebuffed.jar:0.7.0-r2-SNAPSHOT] > at > org.apache.drill.exec.planner.common.DrillUnionRelBase.<init>(DrillUnionRelBase.java:38) > ~[drill-java-exec-0.7.0-r2-SNAPSHOT-rebuffed.jar:0.7.0-r2-SNAPSHOT] > at > org.apache.drill.exec.planner.logical.DrillUnionRel.<init>(DrillUnionRel.java:42) > ~[drill-java-exec-0.7.0-r2-SNAPSHOT-rebuffed.jar:0.7.0-r2-SNAPSHOT] > at > org.apache.drill.exec.planner.logical.DrillUnionRel.copy(DrillUnionRel.java:49) > ~[drill-java-exec-0.7.0-r2-SNAPSHOT-rebuffed.jar:0.7.0-r2-SNAPSHOT] > at > org.apache.drill.exec.planner.logical.DrillUnionRel.copy(DrillUnionRel.java:38) > ~[drill-java-exec-0.7.0-r2-SNAPSHOT-rebuffed.jar:0.7.0-r2-SNAPSHOT] > at org.eigenbase.rel.SetOpRel.copy(SetOpRel.java:73) > ~[optiq-core-0.9-drill-r12.jar:na] > at org.eigenbase.rel.SetOpRel.copy(SetOpRel.java:33) > ~[optiq-core-0.9-drill-r12.jar:na] > at > org.eigenbase.relopt.volcano.RelSubset$CheapestPlanReplacer.visit(RelSubset.java:472) > ~[optiq-core-0.9-drill-r12.jar:na] > at > org.eigenbase.relopt.volcano.RelSubset.buildCheapestPlan(RelSubset.java:287) > ~[optiq-core-0.9-drill-r12.jar:na] > at > org.eigenbase.relopt.volcano.VolcanoPlanner.findBestExp(VolcanoPlanner.java:677) > ~[optiq-core-0.9-drill-r12.jar:na] > at > net.hydromatic.optiq.tools.Programs$RuleSetProgram.run(Programs.java:165) > ~[optiq-core-0.9-drill-r12.jar:na] > at > net.hydromatic.optiq.prepare.PlannerImpl.transform(PlannerImpl.java:276) > ~[optiq-core-0.9-drill-r12.jar:na] > at > org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.convertToDrel(DefaultSqlHandler.java:155) > ~[drill-java-exec-0.7.0-r2-SNAPSHOT-rebuffed.jar:0.7.0-r2-SNAPSHOT] > at > org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.getPlan(DefaultSqlHandler.java:134) > ~[drill-java-exec-0.7.0-r2-SNAPSHOT-rebuffed.jar:0.7.0-r2-SNAPSHOT] > at > org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan(DrillSqlWorker.java:145) > ~[drill-java-exec-0.7.0-r2-SNAPSHOT-rebuffed.jar:0.7.0-r2-SNAPSHOT] > at > org.apache.drill.exec.work.foreman.Foreman.runSQL(Foreman.java:507) > [drill-java-exec-0.7.0-r2-SNAPSHOT-rebuffed.jar:0.7.0-r2-SNAPSHOT] > at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:185) > [drill-java-exec-0.7.0-r2-SNAPSHOT-rebuffed.jar:0.7.0-r2-SNAPSHOT] > ... 4 common frames omitted > {code} > It looks like it fails in optiq ... maybe. -- This message was sent by Atlassian JIRA (v6.3.4#6332)