Zoltan Borok-Nagy 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 9:

(1 comment)

Thanks for the comments. I got a bit stucked with testing.

http://gerrit.cloudera.org:8080/#/c/9005/9/be/src/exec/cardinality-check-node.h
File be/src/exec/cardinality-check-node.h:

http://gerrit.cloudera.org:8080/#/c/9005/9/be/src/exec/cardinality-check-node.h@38
PS9, Line 38:   virtual Status Open(RuntimeState* state) override;
> Tim and I had a discussion about this node and Tim brought up a very import
I tried to craft a test scenario, but couldn't really succeed with it.

Here is what I did:
- to cause the bug, I made CardinalityCheckNode a streaming node, ie. in 
CardinalityCheckNode.java I removed the isBlockingNode() method
- implemented CardinalityCheckNode as a streaming node in 
cardinality-check-node.cc. So GetNext() returns OK if the child returns with 
one row. Then, subsequent GetNext() calls can raise an error if the child 
produces more rows.
- I used hs2/test_fetch.py::TestFetch::test_select_null() as an example of how 
to fetch only one row

But, my fetch always resulted in the "Subquery must return one scalar value" 
error. I couldn't really craft a statement with a plan that had the 
CardinalityCheckNode on the probe side. It was either on the build side, or it 
was a child of a partitioned join.

My best attempt was:
 SELECT int_col
 FROM functional.alltypestiny
 WHERE year = 2009 and month = 2 and
  id = (SELECT at.id
        FROM functional.alltypes at
        LEFT OUTER JOIN functional.alltypesagg ata
        ON (at.id = ata.id)
        WHERE at.id = 3 or ata.id = 3962)

But it is also a partitioned join, and it always raised the "Subquery must 
return one scalar value" error on my first fetch.

Is my approach flawed? Or, do you have a statement in mind that I can use?



--
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: 9
Gerrit-Owner: Zoltan Borok-Nagy <[email protected]>
Gerrit-Reviewer: Alex Behm <[email protected]>
Gerrit-Reviewer: Attila Jeges <[email protected]>
Gerrit-Reviewer: Csaba Ringhofer <[email protected]>
Gerrit-Reviewer: Dimitris Tsirogiannis <[email protected]>
Gerrit-Reviewer: Tim Armstrong <[email protected]>
Gerrit-Reviewer: Vuk Ercegovac <[email protected]>
Gerrit-Reviewer: Zoltan Borok-Nagy <[email protected]>
Gerrit-Comment-Date: Thu, 25 Jan 2018 16:55:08 +0000
Gerrit-HasComments: Yes

Reply via email to