This is an automated email from the ASF dual-hosted git repository.
maxgekk pushed a commit to branch branch-3.4
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/branch-3.4 by this push:
new 6b156ac067b [SPARK-42233][SQL] Improve error message for
`PIVOT_AFTER_GROUP_BY`
6b156ac067b is described below
commit 6b156ac067b33f342beac5b8443f521ee44ba87f
Author: itholic <[email protected]>
AuthorDate: Mon Jan 30 16:50:42 2023 +0300
[SPARK-42233][SQL] Improve error message for `PIVOT_AFTER_GROUP_BY`
### What changes were proposed in this pull request?
This PR proposes to improve error message for `PIVOT_AFTER_GROUP_BY` to
give users better error message.
### Why are the changes needed?
The current error message only shows the cause, not a solution. We should
provide proper solution as well in the error message.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
The existing CI should pass.
Closes #39793 from itholic/PIVOT_AFTER_GROUP_BY.
Authored-by: itholic <[email protected]>
Signed-off-by: Max Gekk <[email protected]>
(cherry picked from commit c1bee1058667b631ed4e027ebb9791698023e9c9)
Signed-off-by: Max Gekk <[email protected]>
---
core/src/main/resources/error/error-classes.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/core/src/main/resources/error/error-classes.json
b/core/src/main/resources/error/error-classes.json
index 8975fe279c2..af5e17d56d4 100644
--- a/core/src/main/resources/error/error-classes.json
+++ b/core/src/main/resources/error/error-classes.json
@@ -1523,7 +1523,7 @@
},
"PIVOT_AFTER_GROUP_BY" : {
"message" : [
- "PIVOT clause following a GROUP BY clause."
+ "PIVOT clause following a GROUP BY clause. Consider pushing the
GROUP BY into a subquery."
]
},
"PIVOT_TYPE" : {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]