Alex Behm has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/9005 )

Change subject: IMPALA-6314: Add run time scalar subquery check for 
uncorrelated subqueries
......................................................................


Patch Set 23:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/9005/23/fe/src/test/java/org/apache/impala/analysis/AnalyzeSubqueriesTest.java
File fe/src/test/java/org/apache/impala/analysis/AnalyzeSubqueriesTest.java:

http://gerrit.cloudera.org:8080/#/c/9005/23/fe/src/test/java/org/apache/impala/analysis/AnalyzeSubqueriesTest.java@1174
PS23, Line 1174:     AnalyzesOk("select id from functional.alltypestiny t where 
int_col < " +
> I see, we'd need a SubPlan for the correct behavior, right?
Correct, we'd need a SubPlan to evaluate such plans. We currently don't support 
such subplans.


http://gerrit.cloudera.org:8080/#/c/9005/23/fe/src/test/java/org/apache/impala/analysis/AnalyzeSubqueriesTest.java@1395
PS23, Line 1395:     AnalyzesOk("select count(1) from functional.alltypes " +
> It sounds like trying to modify the predicate assignment code is a pretty o
Thanks for digging in, Zoltan. I investigated the predicate assignment issue 
and I think we can resolve it as follows:

In StmtRewriter.mergeExpr() we need to set a "limit 2" on the subquery 
statement if it is runtime scalar. That way, we will push migrate or propagate 
predicates into the inline view later at subquery time.

That change along will not work because the predicates will simply disappear 
from the plan due to a bug in CardinalityCheckNode. We need to be sure to not 
call assignConjuncts() in CardinalityCheckNode.init(). That way, we should get 
a SelectNode after the CardinalityCheckNode that contains our predicates at the 
correct place in the plan.

Let me know if you discover any issues!



--
To view, visit http://gerrit.cloudera.org:8080/9005
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I0f52b93a60eeacedd242a2f17fa6b99c4fc38e06
Gerrit-Change-Number: 9005
Gerrit-PatchSet: 23
Gerrit-Owner: Zoltan Borok-Nagy <borokna...@cloudera.com>
Gerrit-Reviewer: Alex Behm <alex.b...@cloudera.com>
Gerrit-Reviewer: Attila Jeges <atti...@cloudera.com>
Gerrit-Reviewer: Csaba Ringhofer <csringho...@cloudera.com>
Gerrit-Reviewer: Dimitris Tsirogiannis <dtsirogian...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <tarmstr...@cloudera.com>
Gerrit-Reviewer: Vuk Ercegovac <vercego...@cloudera.com>
Gerrit-Reviewer: Zoltan Borok-Nagy <borokna...@cloudera.com>
Gerrit-Comment-Date: Mon, 23 Apr 2018 22:08:49 +0000
Gerrit-HasComments: Yes

Reply via email to