You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Aman Sinha (JIRA)" <ji...@apache.org> on 2014/07/12 03:30:05 UTC

[jira] [Commented] (DRILL-1132) CTAS statement gives IndexOutOfBoundsException during planning

    [ https://issues.apache.org/jira/browse/DRILL-1132?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14059573#comment-14059573 ] 

Aman Sinha commented on DRILL-1132:
-----------------------------------


The same problem occurs for the following query with 3 GROUP-BY columns
  create table tt9 as select n_nationkey, n_regionkey, n_name from nation group by n_nationkey, n_regionkey, n_name;

The problem is that when we project the output of the WriterPrel, it has a RowType of 2 columns only:  
         RecordType(VARCHAR(255) Fragment, BIGINT Number of records written)

Whereas we are trying to create a converted Rel with collation and distribution on 3 columns (see below).  Will discuss the desired behavior with relevant folks and provide a fix.

18:22:03.239 [2b29914b-7b51-4f6e-948e-5986a447bea5:foreman] ERROR o.a.drill.exec.work.foreman.Foreman - Error 7f0c2271-ef9a-49ee-bc22-3feb6666b25b: Failure while setting up Foreman.
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.eigenbase.rex.RexBuilder.makeInputRef(RexBuilder.java:731) ~[optiq-core-0.7-20140710.204128-10.jar:na]
        at org.eigenbase.rel.SortRel.<init>(SortRel.java:94) ~[optiq-core-0.7-20140710.204128-10.jar:na]
        at org.eigenbase.rel.SortRel.<init>(SortRel.java:59) ~[optiq-core-0.7-20140710.204128-10.jar:na]
        at org.eigenbase.rel.RelCollationTraitDef.convert(RelCollationTraitDef.java:77) ~[optiq-core-0.7-20140710.204128-10.jar:na]
        at org.eigenbase.rel.RelCollationTraitDef.convert(RelCollationTraitDef.java:36) ~[optiq-core-0.7-20140710.204128-10.jar:na]
        at org.eigenbase.relopt.volcano.VolcanoPlanner.changeTraitsUsingConverters(VolcanoPlanner.java:1002) ~[optiq-core-0.7-20140710.204128-10.jar:na]
        at org.eigenbase.relopt.volcano.VolcanoPlanner.changeTraitsUsingConverters(VolcanoPlanner.java:1094) ~[optiq-core-0.7-20140710.204128-10.jar:na]
        at org.eigenbase.relopt.volcano.AbstractConverter$ExpandConversionRule.onMatch(AbstractConverter.java:107) ~[optiq-core-0.7-20140710.204128-10.jar:na]
        at org.eigenbase.relopt.volcano.VolcanoRuleCall.onMatch(VolcanoRuleCall.java:221) ~[optiq-core-0.7-20140710.204128-10.jar:na]
        at org.eigenbase.relopt.volcano.VolcanoPlanner.findBestExp(VolcanoPlanner.java:653) ~[optiq-core-0.7-20140710.204128-10.jar:na]
        at net.hydromatic.optiq.prepare.PlannerImpl.transform(PlannerImpl.java:271) ~[optiq-core-0.7-20140710.204128-10.jar:na]

> CTAS statement gives IndexOutOfBoundsException during planning
> --------------------------------------------------------------
>
>                 Key: DRILL-1132
>                 URL: https://issues.apache.org/jira/browse/DRILL-1132
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Query Planning & Optimization
>            Reporter: Aman Sinha
>
> Using TPCH schema, the following CTAS statement fails with IOBE during planning: 
> CREATE TABLE T6 AS SELECT  n_regionkey, count(*), n_nationkey  
>   FROM nation
> GROUP BY n_regionkey, n_nationkey;
> message: "Failure while setting up Foreman. < AssertionError:[ Internal error: Error while applying rule ExpandConversionRule, args [rel#18181:AbstractConverter.PHYSICAL.HASH_DISTRIBUTED([[$0], [$2]]).[0, 2](child=rel#17954:Subset#9.PHYSICAL.HASH_DISTRIBUTED([[$0]]).[],convention=PHYSICAL,DrillDistributionTraitDef=HASH_DISTRIBUTED([[$0], [$2]]),sort=[0, 2])] ] < IndexOutOfBoundsException:[ index (2) must be less than size (2) ]"
> ]
> NOTE:  running the SELECT portion of the CTAS succeeds. 



--
This message was sent by Atlassian JIRA
(v6.2#6252)