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-47786] SELECT DISTINCT (*) should not become SELECT DISTINCT struct(*) (revert to previous behavior) #45970

Closed
wants to merge 1 commit into from

Conversation

srielau
Copy link
Contributor

@srielau srielau commented Apr 10, 2024

What changes were proposed in this pull request?

We special case SELECT DISTINCT () to become SELECT DISTINCT *
This prevents (
) to be treated as struct().
We used to ignore parens around stars (
) everywhere, but that is inconsistent with e.g. (c1, c2).
However there seems to be a reasonable number of users treating DISTINCT as a function.

Why are the changes needed?

Prevent regression for a common weird case.

Does this PR introduce any user-facing change?

No, It undoes a user changing change

How was this patch tested?

Existing QA, added new tests to selectExcept.sql

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

No

@github-actions github-actions bot added the SQL label Apr 10, 2024
@cloud-fan
Copy link
Contributor

thanks, merging to master!

@cloud-fan cloud-fan closed this in e8e7dcc Apr 10, 2024
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.

2 participants