-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-17016][SQL] Improve group-by/order-by ordinal error reporting #14594
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
Conversation
| failAnalysis( | ||
| "Group by position: star is not allowed to use in the select list " + | ||
| "when using ordinals in group by") | ||
| "Star (*) is not allowed in select list when GROUP BY ordinal position is used") |
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.
cc @cloud-fan / @gatorsmile do you know why star is not allowed here? I checked Postgres does allow star.
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.
see #10731 (comment)
I think it's not about group by ordinal, but about general group by
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.
but now we do support star in aggregation, cc @rxin
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.
See the original discussion: #10731 (comment)
uh... one hour delay. I did not see @cloud-fan 's answer.
|
Everything is tested here: #14595 |
|
LGTM pending Jenkins. |
|
Test build #63590 has finished for PR 14594 at commit
|
| sql("SELECT 1, 2, sum(b) FROM testData2")) | ||
| } | ||
|
|
||
| test("Group By Ordinal - negative cases") { |
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.
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.
How difficult is it to port the SQLQueryTestSuite harness back to branch-2.0?
## What changes were proposed in this pull request? This patch adds three test files: 1. arithmetic.sql.out 2. order-by-ordinal.sql 3. group-by-ordinal.sql This includes #14594. ## How was this patch tested? This is a test case change. Author: petermaxlee <[email protected]> Closes #14595 from petermaxlee/SPARK-17015.
|
Test build #3217 has finished for PR 14594 at commit
|
|
Test build #63594 has finished for PR 14594 at commit
|
This patch adds three test files: 1. arithmetic.sql.out 2. order-by-ordinal.sql 3. group-by-ordinal.sql This includes #14594. This is a test case change. Author: petermaxlee <[email protected]> Closes #14595 from petermaxlee/SPARK-17015. (cherry picked from commit a7b02db) Signed-off-by: Reynold Xin <[email protected]>
|
Closing this since #14595 was merged. |
What changes were proposed in this pull request?
This patch improves error handling for group-by/order-by ordinals:
Error messages look like the following:
How was this patch tested?
This is tested in SPARK-17015 but I'm submitting this part in isolation so it is easier to back port into branch-2.0. I will submit a separate pull request for SPARK-17015.