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

Error "For SELECT DISTINCT, ORDER BY expressions id must appear in select list" may be over eager #5255

Closed
alamb opened this issue Feb 11, 2023 · 0 comments · Fixed by #5258
Labels
bug Something isn't working

Comments

@alamb
Copy link
Contributor

alamb commented Feb 11, 2023

#5132 added a check that made certain SQL queries error rather than give wrong results (❤️ thanks to @xiaoyong-z !)

However, the way the check is implemented is to match the pattern built by the sql planner for this kind of query. However, if the query is built directly (via a DataFrame or someone using LogicalPlanBuilder directly) it is probably incorrect to throw an error here (as they may have meant to to run the distinct before the sort for some reason)

cc @alamb

Originally posted by @liukun4515 in #5132 (comment)

@alamb alamb added the bug Something isn't working label Feb 11, 2023
@alamb alamb changed the title DISTINCT with ORDER BY error Error "For SELECT DISTINCT, ORDER BY expressions id must appear in select list" may be over eager Feb 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant