You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2018/06/10 19:05:00 UTC

[jira] [Commented] (IMPALA-6314) Add run time scalar subquery check for uncorrelated subqueries

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

ASF subversion and git services commented on IMPALA-6314:
---------------------------------------------------------

Commit e6ca7ca14d4dc64e0f43547c8d9f156ef42d2818 in impala's branch refs/heads/master from Zoltan Borok-Nagy
[ https://git-wip-us.apache.org/repos/asf?p=impala.git;h=e6ca7ca ]

IMPALA-7108: IllegalStateException hit during CardinalityCheckNode.<init>

Since IMPALA-6314 on runtime scalar subqueries we set LIMIT 2
in StmtRewriter.mergeExpr(). We do that because later we add a
CardinalityCheckNode on top of such subqueries and with
LIMIT 2 we can still check if they return more than one row.

In the constructor of CardinalityCheckNode there is a
precondition that checks if the child node has LIMIT 2 to
be certain that we've set the limit for all the necessary
cases.

However, some subqueries will get a LIMIT 1 later breaking the
precondition in CardinalityCheckNode. An example to these
subqueries is a select stmt that selects from an inline view
that returns a single row:

select * from functional.alltypes
where int_col = (select f.id from (
                 select * from functional.alltypes limit 1) f);

Note that we shouldn't add a CardinalityCheckNode to the plan
of this query in the first place. To generate a proper plan I
updated SelectStmt.returnsSingleRow() because this method didn't
handle this case well.

I also changed
the precondition from
Preconditions.checkState(child.getLimit() == 2);
to
Preconditions.checkState(child.getLimit() <= 2);
in order to be more permissive.

I added tests for the aforementioned query.

Change-Id: I82a7a3fe26db3e12131c030c4ad055a9c4955407
Reviewed-on: http://gerrit.cloudera.org:8080/10605
Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>


> Add run time scalar subquery check for uncorrelated subqueries
> --------------------------------------------------------------
>
>                 Key: IMPALA-6314
>                 URL: https://issues.apache.org/jira/browse/IMPALA-6314
>             Project: IMPALA
>          Issue Type: Sub-task
>          Components: Backend, Frontend
>            Reporter: Tim Armstrong
>            Assignee: Zoltán Borók-Nagy
>            Priority: Major
>              Labels: planner, ramp-up, tpc-ds
>             Fix For: Impala 3.0, Impala 2.13.0
>
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org