Uh oh!
There was an error while loading. Please reload this page.
[SPARK-18872][SQL][TESTS] New test cases for EXISTS subquery - #16710
[SPARK-18872][SQL][TESTS] New test cases for EXISTS subquery#16710dilipbiswal wants to merge 2 commits into
Conversation
dilipbiswal
commented
Jan 26, 2017
| emp 2 100.0 | ||
| emp 2 300.0 | ||
| emp 3 300.0 | ||
| emp 4 100.0 |
There was a problem hiding this comment.
I have compared this result file with the attached DB2 output. The two sets of result are equivalent.
| emp 1 10.0 | ||
| emp 1 20.0 | ||
| emp 2 100.0 | ||
| emp 4 100.0 |
There was a problem hiding this comment.
I have compared this result file with the attached DB2 output. The two sets of result are equivalent.
SparkQA
commented
Jan 26, 2017
Test build #72029 has finished for PR 16710 at commit
|
gatorsmile
left a comment
There was a problem hiding this comment.
I did the compare. The results are consistent with the output of DB2.
gatorsmile
commented
Jan 29, 2017
LGTM |
gatorsmile
commented
Jan 29, 2017
Could you update the PR descriptions? Currently, it does not correctly describe the cases you added. |
| WHERE NOT EXISTS (SELECT * | ||
| FROM emp | ||
| WHERE emp.emp_name = emp_name | ||
| AND bonus_amt > emp.salary); |
There was a problem hiding this comment.
Could you also add one more test case, which is very like TC.01.08? This test case is used very often in the real world. BTW, you do not need to run DB2. We can know the results using our naked eyes. : )
-- select values present in one table but missing in another oneSELECT emp.*FROM emp
WHERE NOT EXISTS (SELECTNULLFROM bonus
WHEREbonus.emp_name=emp.emp_name);There was a problem hiding this comment.
@gatorsmile Thanks .. I have added the suggested test case and have updated the PR description.
SparkQA
commented
Jan 29, 2017
Test build #72121 has started for PR 16710 at commit |
dilipbiswal
commented
Jan 29, 2017
retest this please |
SparkQA
commented
Jan 29, 2017
Test build #72125 has finished for PR 16710 at commit
|
gatorsmile
commented
Jan 29, 2017
Thanks! Merging to master. |
dilipbiswal
commented
Jan 29, 2017
Thank you very much @gatorsmile |
## What changes were proposed in this pull request? This PR adds the first set of tests for EXISTS subquery. File name | Brief description ------------------------| ----------------- exists-basic.sql |Tests EXISTS and NOT EXISTS subqueries with both correlated and local predicates. exists-within-and-or.sql|Tests EXISTS and NOT EXISTS subqueries embedded in AND or OR expression. DB2 results are attached here as reference : [exists-basic-db2.txt](https://github.com/apache/spark/files/733031/exists-basic-db2.txt) [exists-and-or-db2.txt](https://github.com/apache/spark/files/733030/exists-and-or-db2.txt) ## How was this patch tested? This patch is adding tests. Author: Dilip Biswal <dbiswal@us.ibm.com> Closesapache#16710 from dilipbiswal/exist-basic.
…ll up to Optimizer phase ## What changes were proposed in this pull request? Currently Analyzer as part of ResolveSubquery, pulls up the correlated predicates to its originating SubqueryExpression. The subquery plan is then transformed to remove the correlated predicates after they are moved up to the outer plan. In this PR, the task of pulling up correlated predicates is deferred to Optimizer. This is the initial work that will allow us to support the form of correlated subqueries that we don't support today. The design document from nsyca can be found in the following link : [DesignDoc](https://docs.google.com/document/d/1QDZ8JwU63RwGFS6KVF54Rjj9ZJyK33d49ZWbjFBaIgU/edit#) The brief description of code changes (hopefully to aid with code review) can be be found in the following link: [CodeChanges](https://docs.google.com/document/d/18mqjhL9V1An-tNta7aVE13HkALRZ5GZ24AATA-Vqqf0/edit#) ## How was this patch tested? The test case PRs were submitted earlier using. [16337](#16337) [16759](#16759) [16841](#16841) [16915](#16915) [16798](#16798) [16712](#16712) [16710](#16710) [16760](#16760) [16802](#16802) Author: Dilip Biswal <dbiswal@us.ibm.com> Closes#16954 from dilipbiswal/SPARK-18874.
What changes were proposed in this pull request?
This PR adds the first set of tests for EXISTS subquery.
DB2 results are attached here as reference :
exists-basic-db2.txt
exists-and-or-db2.txt
How was this patch tested?
This patch is adding tests.