[SPARK-50497][SQL] Fail queries with proper message if MultiAlias contains non-generator function#49072
Closed
mihailomilosevic2001 wants to merge 5 commits intoapache:masterfrom
Closed
[SPARK-50497][SQL] Fail queries with proper message if MultiAlias contains non-generator function#49072mihailomilosevic2001 wants to merge 5 commits intoapache:masterfrom
mihailomilosevic2001 wants to merge 5 commits intoapache:masterfrom
Conversation
# Conflicts: # sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala
Contributor
Author
|
@MaxGekk please review this. |
Contributor
Author
|
@vladimirg-db for context. |
vladimirg-db
reviewed
Dec 5, 2024
| errorClass = "UNBOUND_SQL_PARAMETER", | ||
| messageParameters = Map("name" -> p.name)) | ||
|
|
||
| case ma@MultiAlias(child, names) if child.resolved && !child.isInstanceOf[Generator] => |
Contributor
There was a problem hiding this comment.
Why exactly do we check for child.resolved here?
Contributor
Author
There was a problem hiding this comment.
If child is unresolved, we cannot check for Generator, as we would usually have UnresolvedFunction.
cloud-fan
reviewed
Dec 9, 2024
| }, | ||
| "MULTI_ALIAS_WITHOUT_GENERATOR" : { | ||
| "message" : [ | ||
| "Multi part aliasing (<names>) is not supported with <expr> as it is not a generator function." |
Contributor
There was a problem hiding this comment.
is Multi part aliasing an official name in SQL standard?
Contributor
There was a problem hiding this comment.
It's not a concept at all. I don't have a better name.
srielau
approved these changes
Dec 9, 2024
Contributor
|
thanks, merging to master! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
MultiAlias fails if the underlying function is not a generator.
Why are the changes needed?
Syntax for multi aliasing should return proper error and not fail in check analysis with unresolved.
Does this PR introduce any user-facing change?
Yes, error message changes
How was this patch tested?
Added test.
Was this patch authored or co-authored using generative AI tooling?
Yes.