-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-33125][SQL] Improve the error when Lead and Lag are not allowed to specify window frame #30021
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
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
Show resolved
Hide resolved
| if wf.frame != UnspecifiedFrame && wf.frame != f => | ||
| failAnalysis(s"Window Frame $f must match the required frame ${wf.frame}") | ||
| case WindowExpression(owf: OffsetWindowFunction, | ||
| WindowSpecDefinition(_, _, _: SpecifiedWindowFrame)) => |
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.
OffsetWindowFunction can use UnspecifiedFrame now?
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.
I got it.
|
Kubernetes integration test starting |
|
Test build #129723 has finished for PR 30021 at commit
|
|
Kubernetes integration test status success |
|
Kubernetes integration test starting |
|
Test build #129725 has finished for PR 30021 at commit
|
|
Kubernetes integration test status success |
|
Test build #129730 has finished for PR 30021 at commit
|
|
Kubernetes integration test starting |
|
Kubernetes integration test status failure |
|
Kubernetes integration test starting |
|
Kubernetes integration test status success |
|
Test build #129732 has finished for PR 30021 at commit
|
|
thanks, merging to master! |
|
@cloud-fan Thanks for your help! |
What changes were proposed in this pull request?
Except for Postgresql, other data sources (for example: vertica, oracle, redshift, mysql, presto) are not allowed to specify window frame for the Lead and Lag functions.
But the current error message is not clear enough.
Window Frame $f must match the required frameThis PR will use the following error message.
Cannot specify window frame for lead functionWhy are the changes needed?
Make clear error message.
Does this PR introduce any user-facing change?
Yes
Users will see the clearer error message.
How was this patch tested?
Jenkins test.