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

Ramana Inukonda Nagaraj commented on DRILL-388:
-----------------------------------------------

Seeing a different error for the same issue:

0: jdbc:drill:schema=dfs.drillTestDir> select  debt from 
`parquet_storage/customer_alltypes.plain.parquet`order by cust_key;
Query failed: org.apache.drill.exec.rpc.RpcException: Remote failure while 
running query.[error_id: "6e01a775-8b7d-423e-96e6-6f17041323c3"
endpoint {
  address: "drillats4.qa.lab"
  user_port: 31010
  control_port: 31011
  data_port: 31012
}
error_type: 0
message: "Failure while setting up Foreman. < AssertionError:[ Internal error: 
Error while applying rule ExpandConversionRule, args 
[rel#11688:AbstractConverter.LOGICAL.ANY([]).[1](child=rel#11680:Subset#3.LOGICAL.ANY([]).[],convention=LOGICAL,DrillDistributionTraitDef=ANY([]),sort=[1])]
 ] < IndexOutOfBoundsException:[ index (1) must be less than size (1) ]"
]
Error: exception while executing query (state=,code=0)

Lilith logs show:

java.lang.IndexOutOfBoundsException: index (1) must be less than size (1)
        
com.google.common.base.Preconditions.checkElementIndex(Preconditions.java:305) 
~[guava-14.0.1.jar:na]
        
com.google.common.base.Preconditions.checkElementIndex(Preconditions.java:284) 
~[guava-14.0.1.jar:na]
        
com.google.common.collect.SingletonImmutableList.get(SingletonImmutableList.java:45)
 ~[guava-14.0.1.jar:na]
        org.eigenbase.rex.RexBuilder.makeInputRef(RexBuilder.java:731) 
~[optiq-core-0.7-20140513.013236-5.jar:na]
        org.eigenbase.rel.SortRel.<init>(SortRel.java:94) 
~[optiq-core-0.7-20140513.013236-5.jar:na]
        org.eigenbase.rel.SortRel.<init>(SortRel.java:59) 
~[optiq-core-0.7-20140513.013236-5.jar:na]
        
org.eigenbase.rel.RelCollationTraitDef.convert(RelCollationTraitDef.java:77) 
~[optiq-core-0.7-20140513.013236-5.jar:na]
        
org.eigenbase.rel.RelCollationTraitDef.convert(RelCollationTraitDef.java:36) 
~[optiq-core-0.7-20140513.013236-5.jar:na]
        
org.eigenbase.relopt.volcano.VolcanoPlanner.changeTraitsUsingConverters(VolcanoPlanner.java:1002)
 ~[optiq-core-0.7-20140513.013236-5.jar:na]
        
org.eigenbase.relopt.volcano.VolcanoPlanner.changeTraitsUsingConverters(VolcanoPlanner.java:1094)
 ~[optiq-core-0.7-20140513.013236-5.jar:na]
        
org.eigenbase.relopt.volcano.AbstractConverter$ExpandConversionRule.onMatch(AbstractConverter.java:107)
 ~[optiq-core-0.7-20140513.013236-5.jar:na]
        
org.eigenbase.relopt.volcano.VolcanoRuleCall.onMatch(VolcanoRuleCall.java:221) 
~[optiq-core-0.7-20140513.013236-5.jar:na]
        
org.eigenbase.relopt.volcano.VolcanoPlanner.findBestExp(VolcanoPlanner.java:653)
 ~[optiq-core-0.7-20140513.013236-5.jar:na]
        
net.hydromatic.optiq.prepare.PlannerImpl.transform(PlannerImpl.java:271) 
~[optiq-core-0.7-20140513.013236-5.jar:na]
        
org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.convertToDrel(DefaultSqlHandler.java:107)
 
~[drill-java-exec-1.0.0-m2-incubating-SNAPSHOT-rebuffed.jar:1.0.0-m2-incubating-SNAPSHOT]
        
org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.getPlan(DefaultSqlHandler.java:87)
 
~[drill-java-exec-1.0.0-m2-incubating-SNAPSHOT-rebuffed.jar:1.0.0-m2-incubating-SNAPSHOT]
        
org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan(DrillSqlWorker.java:134)
 
~[drill-java-exec-1.0.0-m2-incubating-SNAPSHOT-rebuffed.jar:1.0.0-m2-incubating-SNAPSHOT]
        org.apache.drill.exec.work.foreman.Foreman.runSQL(Foreman.java:338) 
~[drill-java-exec-1.0.0-m2-incubating-SNAPSHOT-rebuffed.jar:1.0.0-m2-incubating-SNAPSHOT]
        org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:186) 
~[drill-java-exec-1.0.0-m2-incubating-SNAPSHOT-rebuffed.jar:1.0.0-m2-incubating-SNAPSHOT]
        
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 
[na:1.7.0_45]
        
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 
[na:1.7.0_45]
        java.lang.Thread.run(Thread.java:744) [na:1.7.0_45]

git commit id: 70fab8c


> Doing an ORDER-BY on a column not in the SELECT list gives CannotPlanException
> ------------------------------------------------------------------------------
>
>                 Key: DRILL-388
>                 URL: https://issues.apache.org/jira/browse/DRILL-388
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Query Planning & Optimization
>            Reporter: Aman Sinha
>            Assignee: Mehant Baid
>
> Queries of the following type where order-by column is not in SELECT list 
> give a CannotPlanException.  A partial stack trace is shown below. 
> 0: jdbc:drill:schema=parquet-local> select _MAP['N_NATIONKEY'] as n_nationkey 
> from "/Users/asinha/parquet/nation.parquet" order by _MAP['N_REGIONKEY'];
> org.eigenbase.relopt.RelOptPlanner$CannotPlanException: Node 
> [rel#10788:Subset#3.ENUMERABLE.PRESERVE] could not be implemented; planner 
> state:
> Root: rel#10788:Subset#3.ENUMERABLE.PRESERVE
> Original rel:
> AbstractConverter(subset=[rel#10788:Subset#3.ENUMERABLE.PRESERVE], 
> convention=[ENUMERABLE], sort=[PRESERVE])
>   ProjectRel(subset=[rel#10784:Subset#3.NONE.PRESERVE], N_NATIONKEY=[$0])
>     SortRel(subset=[rel#10782:Subset#2.NONE.[1 Ascending]], sort0=[$1], 
> dir0=[Ascending])
>       ProjectRel(subset=[rel#10780:Subset#1.NONE.[]], N_NATIONKEY=[ITEM($0, 
> 'N_NATIONKEY')], EXPR$1=[ITEM($0, 'N_REGIONKEY')])
>         DrillScan(subset=[rel#10778:Subset#0.DRILL.[]], 
> table=[[parquet-local, /Users/asinha/parquet/nation.parquet]])
> Sets:
> Set#0, type: RecordType((VARCHAR, ANY) MAP _MAP)
>       rel#10778:Subset#0.DRILL.[], best=rel#10774, importance=0.6561
>               rel#10774:DrillScan.DRILL.[](table=[parquet-local, 
> /Users/asinha/parquet/nation.parquet]), rowcount=100.0, cumulative 
> cost={100.0 rows, 101.0 cpu, 0.0 io}
>               
> rel#12031:AbstractConverter.DRILL.[](child=rel#12030:Subset#0.ENUMERABLE.[],convention=DRILL,sort=[]),
>  rowcount=100.0, cumulative cost={inf}
>       rel#12030:Subset#0.ENUMERABLE.[], best=rel#12029, 
> importance=0.5904900000000001
>               
> rel#12032:AbstractConverter.ENUMERABLE.[](child=rel#10778:Subset#0.DRILL.[],convention=ENUMERABLE,sort=[]),
>  rowcount=100.0, cumulative cost={inf}
>               
> rel#12029:EnumerableDrillRel.ENUMERABLE.[](child=rel#10778:Subset#0.DRILL.[]),
>  rowcount=100.0, cumulative cost={110.0 rows, 111.0 cpu, 0.0 io}
> Set#1, type: RecordType(ANY N_NATIONKEY, ANY EXPR$1)
>       rel#10780:Subset#1.NONE.[], best=null, importance=0.7290000000000001
>               
> rel#10779:ProjectRel.NONE.[](child=rel#10778:Subset#0.DRILL.[],N_NATIONKEY=ITEM($0,
>  'N_NATIONKEY'),EXPR$1=ITEM($0, 'N_REGIONKEY')), rowcount=100.0, cumulative 
> cost={inf}
>               
> rel#10791:CalcRel.NONE.[](child=rel#10778:Subset#0.DRILL.[],expr#0={inputs},expr#1='N_NATIONKEY',expr#2=ITEM($t0,
>  $t1),expr#3='N_REGIONKEY',expr#4=ITEM($t0, $t3),N_NATIONKEY=$t2,EXPR$1=$t4), 
> rowcount=100.0, cumulative cost={inf}
>               rel#11466:SortRel.NONE.[](child=rel#10833:Subset#1.DRILL.[1 
> Ascending]), rowcount=100.0, cumulative cost={inf}
>               
> rel#11597:SortRel.NONE.[](child=rel#10828:Subset#1.DRILL.PRESERVE), 
> rowcount=1.7976931348623157E308, cumulative cost={inf}
>               
> rel#11701:SortRel.NONE.[](child=rel#11115:Subset#1.ENUMERABLE.PRESERVE), 
> rowcount=1.7976931348623157E308, cumulative cost={inf}
>               
> rel#11803:SortRel.NONE.[](child=rel#11082:Subset#1.ENUMERABLE.[1 Ascending]), 
> rowcount=100.0, cumulative cost={inf}
>       rel#10804:Subset#1.DRILL.[], best=rel#10821, 
> importance=0.5904900000000001
>               
> rel#10805:AbstractConverter.DRILL.[](child=rel#10780:Subset#1.NONE.[],convention=DRILL,sort=[]),
>  rowcount=1.7976931348623157E308, cumulative cost={inf}
>               
> rel#10821:DrillProjectRel.DRILL.[](child=rel#10778:Subset#0.DRILL.[],N_NATIONKEY=ITEM($0,
>  'N_NATIONKEY'),EXPR$1=ITEM($0, 'N_REGIONKEY')), rowcount=100.0, cumulative 
> cost={110.0 rows, 121.0 cpu, 0.0 io}
>               
> rel#10825:AbstractConverter.DRILL.[](child=rel#10824:Subset#1.NONE.[1 
> Ascending],convention=DRILL,sort=[]), rowcount=1.7976931348623157E308, 
> cumulative cost={inf}



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

Reply via email to