Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-3382

CTAS with order by clause fails with IOOB exception

    Details

      Description

      The query :

      create table `lineitem__5` as select l_suppkey, l_partkey, l_linenumber from cp.`tpch/lineitem.parquet` l order by l_linenumber;

      fails with an IOOB exception

      Trace in log -

      [Error Id: 3351dcf3-032f-4d10-b2a4-c42959d0c06a on localhost:31010]
      org.apache.drill.common.exceptions.UserException: SYSTEM ERROR: IndexOutOfBoundsException: index (2) must be less than size (2)

      [Error Id: 3351dcf3-032f-4d10-b2a4-c42959d0c06a on localhost:31010]
      at org.apache.drill.common.exceptions.UserException$Builder.build(UserException.java:523) ~[drill-common-1.1.0-SNAPSHOT.jar:1.1.0-SNAPSHOT]
      at org.apache.drill.exec.work.foreman.Foreman$ForemanResult.close(Foreman.java:737) [drill-java-exec-1.1.0-SNAPSHOT.jar:1.1.0-SNAPSHOT]
      at org.apache.drill.exec.work.foreman.Foreman$StateSwitch.processEvent(Foreman.java:839) [drill-java-exec-1.1.0-SNAPSHOT.jar:1.1.0-SNAPSHOT]
      at org.apache.drill.exec.work.foreman.Foreman$StateSwitch.processEvent(Foreman.java:781) [drill-java-exec-1.1.0-SNAPSHOT.jar:1.1.0-SNAPSHOT]
      at org.apache.drill.common.EventProcessor.sendEvent(EventProcessor.java:73) [drill-common-1.1.0-SNAPSHOT.jar:1.1.0-SNAPSHOT]
      at org.apache.drill.exec.work.foreman.Foreman$StateSwitch.moveToState(Foreman.java:783) [drill-java-exec-1.1.0-SNAPSHOT.jar:1.1.0-SNAPSHOT]
      at org.apache.drill.exec.work.foreman.Foreman.moveToState(Foreman.java:892) [drill-java-exec-1.1.0-SNAPSHOT.jar:1.1.0-SNAPSHOT]
      at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:253) [drill-java-exec-1.1.0-SNAPSHOT.jar:1.1.0-SNAPSHOT]
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_65]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_65]
      at java.lang.Thread.run(Thread.java:745) [na:1.7.0_65]
      Caused by: org.apache.drill.exec.work.foreman.ForemanException: Unexpected exception during fragment initialization: Internal error: Error while applying rule ExpandConversionRule, args [rel#9013:AbstractConverter.PHYSICAL.SINGLETON([]).[2](input=rel#9011:Subset#7.PHYSICAL.ANY([]).[2],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[2])]
      ... 4 common frames omitted
      Caused by: java.lang.AssertionError: Internal error: Error while applying rule ExpandConversionRule, args [rel#9013:AbstractConverter.PHYSICAL.SINGLETON([]).[2](input=rel#9011:Subset#7.PHYSICAL.ANY([]).[2],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[2])]
      at org.apache.calcite.util.Util.newInternal(Util.java:790) ~[calcite-core-1.1.0-drill-r9.jar:1.1.0-drill-r9]
      at org.apache.calcite.plan.volcano.VolcanoRuleCall.onMatch(VolcanoRuleCall.java:251) ~[calcite-core-1.1.0-drill-r9.jar:1.1.0-drill-r9]
      at org.apache.calcite.plan.volcano.VolcanoPlanner.findBestExp(VolcanoPlanner.java:795) ~[calcite-core-1.1.0-drill-r9.jar:1.1.0-drill-r9]
      at org.apache.calcite.tools.Programs$RuleSetProgram.run(Programs.java:303) ~[calcite-core-1.1.0-drill-r9.jar:1.1.0-drill-r9]
      at org.apache.calcite.prepare.PlannerImpl.transform(PlannerImpl.java:316) ~[calcite-core-1.1.0-drill-r9.jar:1.1.0-drill-r9]
      at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.convertToPrel(DefaultSqlHandler.java:260) ~[drill-java-exec-1.1.0-SNAPSHOT.jar:1.1.0-SNAPSHOT]
      at org.apache.drill.exec.planner.sql.handlers.CreateTableHandler.convertToPrel(CreateTableHandler.java:120) ~[drill-java-exec-1.1.0-SNAPSHOT.jar:1.1.0-SNAPSHOT]
      at org.apache.drill.exec.planner.sql.handlers.CreateTableHandler.getPlan(CreateTableHandler.java:99) ~[drill-java-exec-1.1.0-SNAPSHOT.jar:1.1.0-SNAPSHOT]
      at org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan(DrillSqlWorker.java:178) ~[drill-java-exec-1.1.0-SNAPSHOT.jar:1.1.0-SNAPSHOT]
      at org.apache.drill.exec.work.foreman.Foreman.runSQL(Foreman.java:903) [drill-java-exec-1.1.0-SNAPSHOT.jar:1.1.0-SNAPSHOT]
      at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:242) [drill-java-exec-1.1.0-SNAPSHOT.jar:1.1.0-SNAPSHOT]
      ... 3 common frames omitted
      Caused by: java.lang.IndexOutOfBoundsException: index (2) must be less than size (2)
      at com.google.common.base.Preconditions.checkElementIndex(Preconditions.java:305) ~[guava-14.0.1.jar:na]
      at com.google.common.base.Preconditions.checkElementIndex(Preconditions.java:284) ~[guava-14.0.1.jar:na]
      at com.google.common.collect.RegularImmutableList.get(RegularImmutableList.java:81) ~[guava-14.0.1.jar:na]
      at org.apache.calcite.rex.RexBuilder.makeInputRef(RexBuilder.java:768) ~[calcite-core-1.1.0-drill-r9.jar:1.1.0-drill-r9]
      at org.apache.calcite.rel.core.Sort.<init>(Sort.java:103) ~[calcite-core-1.1.0-drill-r9.jar:1.1.0-drill-r9]
      at org.apache.calcite.rel.logical.LogicalSort.<init>(LogicalSort.java:37) ~[calcite-core-1.1.0-drill-r9.jar:1.1.0-drill-r9]
      at org.apache.calcite.rel.logical.LogicalSort.create(LogicalSort.java:63) ~[calcite-core-1.1.0-drill-r9.jar:1.1.0-drill-r9]
      at org.apache.calcite.rel.RelCollationTraitDef.convert(RelCollationTraitDef.java:79) ~[calcite-core-1.1.0-drill-r9.jar:1.1.0-drill-r9]
      at org.apache.calcite.rel.RelCollationTraitDef.convert(RelCollationTraitDef.java:39) ~[calcite-core-1.1.0-drill-r9.jar:1.1.0-drill-r9]
      at org.apache.calcite.plan.volcano.VolcanoPlanner.changeTraitsUsingConverters(VolcanoPlanner.java:1180) ~[calcite-core-1.1.0-drill-r9.jar:1.1.0-drill-r9]
      at org.apache.calcite.plan.volcano.VolcanoPlanner.changeTraitsUsingConverters(VolcanoPlanner.java:1272) ~[calcite-core-1.1.0-drill-r9.jar:1.1.0-drill-r9]
      at org.apache.calcite.plan.volcano.AbstractConverter$ExpandConversionRule.onMatch(AbstractConverter.java:115) ~[calcite-core-1.1.0-drill-r9.jar:1.1.0-drill-r9]
      at org.apache.calcite.plan.volcano.VolcanoRuleCall.onMatch(VolcanoRuleCall.java:228) ~[calcite-core-1.1.0-drill-r9.jar:1.1.0-drill-r9]
      ... 12 common frames omitted

        Attachments

          Activity

            People

            • Assignee:
              jni Jinfeng Ni
              Reporter:
              parthc Parth Chandra
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: