drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Krystal (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DRILL-1302) Order by using table.col in subquery fails with ArrayIndexOutOfBoundsException
Date Thu, 14 Aug 2014 22:02:19 GMT

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

Krystal commented on DRILL-1302:
--------------------------------

Server Error:
java.lang.ArrayIndexOutOfBoundsException: -1
org.eigenbase.rex.RexProgram.deduceCollations(RexProgram.java:564) ~[optiq-core-0.9-20140730.000241-5.jar:na]
org.eigenbase.rex.RexProgram.getCollations(RexProgram.java:533) ~[optiq-core-0.9-20140730.000241-5.jar:na]
org.eigenbase.rel.CalcRel.createProject(CalcRel.java:146) ~[optiq-core-0.9-20140730.000241-5.jar:na]
org.eigenbase.rel.CalcRel.createProject(CalcRel.java:88) ~[optiq-core-0.9-20140730.000241-5.jar:na]
org.eigenbase.sql2rel.SqlToRelConverter.convertSelectList(SqlToRelConverter.java:3313) ~[optiq-core-0.9-20140730.000241-5.jar:na]
org.eigenbase.sql2rel.SqlToRelConverter.convertSelectImpl(SqlToRelConverter.java:519) ~[optiq-core-0.9-20140730.000241-5.jar:na]
org.eigenbase.sql2rel.SqlToRelConverter.convertSelect(SqlToRelConverter.java:474) ~[optiq-core-0.9-20140730.000241-5.jar:na]
org.eigenbase.sql2rel.SqlToRelConverter.convertQueryRecursive(SqlToRelConverter.java:2654)
~[optiq-core-0.9-20140730.000241-5.jar:na]
org.eigenbase.sql2rel.SqlToRelConverter.convertQuery(SqlToRelConverter.java:432) ~[optiq-core-0.9-20140730.000241-5.jar:na]
net.hydromatic.optiq.prepare.PlannerImpl.convert(PlannerImpl.java:186) ~[optiq-core-0.9-20140730.000241-5.jar:na]
org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.convertToRel(DefaultSqlHandler.java:141)
~[drill-java-exec-0.5.0-incubating-SNAPSHOT-rebuffed.jar:0.5.0-incubating-SNAPSHOT]
org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.getPlan(DefaultSqlHandler.java:118)
~[drill-java-exec-0.5.0-incubating-SNAPSHOT-rebuffed.jar:0.5.0-incubating-SNAPSHOT]
org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan(DrillSqlWorker.java:128) ~[drill-java-exec-0.5.0-incubating-SNAPSHOT-rebuffed.jar:0.5.0-incubating-SNAPSHOT]
org.apache.drill.exec.work.foreman.Foreman.runSQL(Foreman.java:403) [drill-java-exec-0.5.0-incubating-SNAPSHOT-rebuffed.jar:0.5.0-incubating-SNAPSHOT]
org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:219) [drill-java-exec-0.5.0-incubating-SNAPSHOT-rebuffed.jar:0.5.0-incubating-SNAPSHOT]
org.apache.drill.exec.work.WorkManager$RunnableWrapper.run(WorkManager.java:250) [drill-java-exec-0.5.0-incubating-SNAPSHOT-rebuffed.jar:0.5.0-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]

> Order by using table.col in subquery fails with ArrayIndexOutOfBoundsException 
> -------------------------------------------------------------------------------
>
>                 Key: DRILL-1302
>                 URL: https://issues.apache.org/jira/browse/DRILL-1302
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Query Planning & Optimization
>            Reporter: Krystal
>
> git.commit.id.abbrev=687b9b0
> The following query runs successfully:
> select cast(student.name as varchar(30)) name, cast(voter.registration as varchar(20))
registration from voter full outer join student on (student.name = voter.name) where student.age
< 20 order by student.name;
> If I put the above query in a sub-select, it fails:
> 0: jdbc:drill:schema=dfs> select tbl.name, tbl.registration from (select cast(student.name
as varchar(30)) name, cast(voter.registration as varchar(20)) registration from `dfs`.`default`.`./voter`
voter full outer join `dfs`.`default`.`./student` student on (student.name = voter.name) where
student.age < 20 order by student.name) tbl;
> Query failed: Failure while parsing sql. -1 [fe42e70f-cf5b-4389-b879-5b1598ab887f]
> Error: exception while executing query: Failure while trying to get next result batch.
(state=,code=0)
> If I change the query using "order by name" without specifying the student table, the
query runs fine:
> 0: jdbc:drill:schema=dfs> select tbl.name, tbl.registration from (select cast(student.name
as varchar(30)) name, cast(voter.registration as varchar(20)) registration from `dfs`.`default`.`./voter`
voter full outer join `dfs`.`default`.`./student` student on (student.name = voter.name) where
student.age < 20 order by student.name) tbl;
> The student.name in the order by clause should work.



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

Mime
View raw message