Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

wayneguow
Copy link
Contributor

@wayneguow wayneguow commented Jul 17, 2024

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

Was this patch authored or co-authored using generative AI tooling?

No.

@github-actions github-actions bot added the SQL label Jul 17, 2024
@wayneguow wayneguow changed the title [SPARK-48915][SQL][TESTS] Add some covered predicates(!=, <=, >, >=) in test cases of GeneratedSubquerySuite [SPARK-48915][SQL][TESTS] Add some uncovered predicates(!=, <=, >, >=) in test cases of GeneratedSubquerySuite Jul 17, 2024
@wayneguow
Copy link
Contributor Author

cc @cloud-fan @andylam-db

Copy link
Contributor

@andylam-db andylam-db left a 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.

@wayneguow
Copy link
Contributor Author

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.

@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 {
Copy link
Contributor Author

@wayneguow wayneguow Jul 17, 2024

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

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds great!

@cloud-fan
Copy link
Contributor

thanks, merging to master!

@cloud-fan cloud-fan closed this in 9d4ebf7 Jul 18, 2024
HyukjinKwon pushed a commit that referenced this pull request Jul 19, 2024
… <, <=, >, >=) 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>
jingz-db pushed a commit to jingz-db/spark that referenced this pull request Jul 22, 2024
…) 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>
jingz-db pushed a commit to jingz-db/spark that referenced this pull request Jul 22, 2024
… <, <=, >, >=) 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants