-
Notifications
You must be signed in to change notification settings - Fork 28.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-48915][SQL][TESTS] Add some uncovered predicates(!=, <=, >, >=) in test cases of GeneratedSubquerySuite
#47386
Conversation
GeneratedSubquerySuite
GeneratedSubquerySuite
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
Your implementation improves coverage of predicate types of scalar subquery in the WHERE clause, but I think the ticket is asking for different predicate types in the correlation predicate (within the subquery itself). Your PR is helpful of course, and I think we should merge it, but I think the ask on the ticket is different.
sql/core/src/test/scala/org/apache/spark/sql/QueryGeneratorHelper.scala
Outdated
Show resolved
Hide resolved
@andylam-db Thank you for your explanation. In addition to the current PR, I may be able to open a new PR. |
@@ -182,8 +182,11 @@ class GeneratedSubquerySuite extends DockerJDBCIntegrationSuite with QueryGenera | |||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If want to further solve the ticket, currently there is only =
(Equals
) here, we should be able to generate Query for !=, <, <=, >, >= where the upper layer calls. Is this right? @andylam-db
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I understand what you mean by where the upper layer calls
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, sorry, I didn't make it clear, I meant in line359-362,
for { subqueryOperator <- subqueryOperators isDistinct <- distinctChoices(subqueryOperator) }
add another axis about correlationConditions
here to cover all the different predicates, not only hardcoded about =
in generateQuery
method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds great!
thanks, merging to master! |
… <, <=, >, >=) for correlation in `GeneratedSubquerySuite` ### What changes were proposed in this pull request? In PR #47386, we improves coverage of predicate types of scalar subquery in the WHERE clause. Follow up, this PR as aims to add some uncovered predicates(!=, <, <=, >, >=) for correlation in `GeneratedSubquerySuite`. ### Why are the changes needed? Better coverage of current subquery tests with correlation in `GeneratedSubquerySuite`. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass GA. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #47399 from wayneguow/SPARK-48915_follow_up. Authored-by: Wei Guo <guow93@gmail.com> Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
…) in test cases of `GeneratedSubquerySuite` ### What changes were proposed in this pull request? This PR aims to add some predicates(!=, <=, >, >=) which are not covered in test cases of `GeneratedSubquerySuite`. ### Why are the changes needed? Better coverage of current subquery tests in `GeneratedSubquerySuite`. For more information about subqueries in `postgresq`, refer to: https://www.postgresql.org/docs/current/functions-subquery.html#FUNCTIONS-SUBQUERY https://www.postgresql.org/docs/current/functions-comparisons.html#ROW-WISE-COMPARISON ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass GA and Manual testing with `GeneratedSubquerySuite`. ![image](https://github.com/user-attachments/assets/4b265def-a7a9-405e-94ce-e9902efb79fa) ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#47386 from wayneguow/SPARK-48915. Authored-by: Wei Guo <guow93@gmail.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com>
… <, <=, >, >=) for correlation in `GeneratedSubquerySuite` ### What changes were proposed in this pull request? In PR apache#47386, we improves coverage of predicate types of scalar subquery in the WHERE clause. Follow up, this PR as aims to add some uncovered predicates(!=, <, <=, >, >=) for correlation in `GeneratedSubquerySuite`. ### Why are the changes needed? Better coverage of current subquery tests with correlation in `GeneratedSubquerySuite`. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass GA. ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#47399 from wayneguow/SPARK-48915_follow_up. Authored-by: Wei Guo <guow93@gmail.com> Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
What changes were proposed in this pull request?
This PR aims to add some predicates(!=, <=, >, >=) which are not covered in test cases of
GeneratedSubquerySuite
.Why are the changes needed?
Better coverage of current subquery tests in
GeneratedSubquerySuite
.For more information about subqueries in
postgresq
, refer to:https://www.postgresql.org/docs/current/functions-subquery.html#FUNCTIONS-SUBQUERY
https://www.postgresql.org/docs/current/functions-comparisons.html#ROW-WISE-COMPARISON
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Pass GA and Manual testing with
GeneratedSubquerySuite
.Was this patch authored or co-authored using generative AI tooling?
No.