You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Parth Chandra (JIRA)" <ji...@apache.org> on 2015/04/09 21:20:12 UTC

[jira] [Resolved] (DRILL-2233) IOB exception when scalar subquery is used in the IN clause

     [ https://issues.apache.org/jira/browse/DRILL-2233?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Parth Chandra resolved DRILL-2233.
----------------------------------
    Resolution: Fixed

Issue is fixed in master.  The server will return an error for this operation.
There is a separate issue to track the exception thrown by sqlline (DRILL-2737)

> IOB exception when scalar subquery is used in the IN clause
> -----------------------------------------------------------
>
>                 Key: DRILL-2233
>                 URL: https://issues.apache.org/jira/browse/DRILL-2233
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Client - CLI
>            Reporter: Victoria Markman
>            Assignee: Parth Chandra
>             Fix For: 0.9.0
>
>         Attachments: drillbit.log, t1.parquet, t2.parquet
>
>
> Failing query:
> {code}
> SELECT a1, 
>        COUNT(*) 
> FROM   t1 
> WHERE  ( a1 ) IN (SELECT MAX(a2) 
>                                FROM   t2) 
> GROUP  BY a1 
> ORDER  BY a1; 
> {code}
> {code}
> 0: jdbc:drill:schema=dfs> select a1, count(*) from t1 where (a1) in (select  min(a2) from t2) group by a1 order by a1;
> +------------+------------+
> |     a1     |   EXPR$1   |
> +------------+------------+
> Query failed: RemoteRpcException: Failure while running fragment., index: 0, length: 1 (expected: range(0, 0)) [ 00b3ed27-67be-4343-849b-b9b783cabe07 on atsqa4-133.qa.lab:31010 ]
> [ 00b3ed27-67be-4343-849b-b9b783cabe07 on atsqa4-133.qa.lab:31010 ]
> java.lang.RuntimeException: java.sql.SQLException: Failure while executing query.
>         at sqlline.SqlLine$IncrementalRows.hasNext(SqlLine.java:2514)
>         at sqlline.SqlLine$TableOutputFormat.print(SqlLine.java:2148)
>         at sqlline.SqlLine.print(SqlLine.java:1809)
>         at sqlline.SqlLine$Commands.execute(SqlLine.java:3766)
>         at sqlline.SqlLine$Commands.sql(SqlLine.java:3663)
>         at sqlline.SqlLine.dispatch(SqlLine.java:889)
>         at sqlline.SqlLine.begin(SqlLine.java:763)
>         at sqlline.SqlLine.start(SqlLine.java:498)
>         at sqlline.SqlLine.main(SqlLine.java:460)
> {code}
> Query plan:
> {code}
> 00-01      Project(a1=[$0], EXPR$1=[$1])
> 00-02        SelectionVectorRemover
> 00-03          Sort(sort0=[$0], dir0=[ASC])
> 00-04            Project(a1=[$0], EXPR$1=[$1])
> 00-05              HashAgg(group=[{0}], EXPR$1=[COUNT()])
> 00-06                Project($f1=[$0])
> 00-07                  HashJoin(condition=[=($1, $2)], joinType=[inner])
> 00-09                    Project($f1=[$0], $f2=[$0])
> 00-11                      Scan(groupscan=[ParquetGroupScan [entries=[ReadEntryWithPath [path=maprfs:/aggregation/t1]], selectionRoot=/aggregation/t1, numFiles=1, columns=[`a1`]]])
> 00-08                    HashAgg(group=[{0}])
> 00-10                      StreamAgg(group=[{}], EXPR$0=[MIN($0)])
> 00-12                        Scan(groupscan=[ParquetGroupScan [entries=[ReadEntryWithPath [path=maprfs:/aggregation/t2]], selectionRoot=/aggregation/t2, numFiles=1, columns=[`a2`]]])
> {code}
> Same query with "not in" works correctly:
> {code}
> 0: jdbc:drill:schema=dfs> select a1, count(*) from t1 where (a1) not in (select  max(a2) from t2) group by a1 order by a1;
> +------------+------------+
> |     a1     |   EXPR$1   |
> +------------+------------+
> | 1          | 1          |
> | 2          | 1          |
> | 3          | 1          |
> | 4          | 1          |
> | 5          | 1          |
> | 6          | 1          |
> | 7          | 1          |
> | 10         | 1          |
> +------------+------------+
> 8 rows selected (0.182 seconds)
> {code}
> I'm choosing "Execution-general" component, because query plan at the first glance looks correct.
> {code}
> #Thu Feb 12 12:13:26 EST 2015
> git.commit.id.abbrev=de89f36
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)