-
Notifications
You must be signed in to change notification settings - Fork 28.4k
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
[SPARK-50322][SQL] Fix parameterized identifier in a sub-query #48847
Conversation
sql/core/src/test/scala/org/apache/spark/sql/ParametersSuite.scala
Outdated
Show resolved
Hide resolved
@@ -189,7 +189,8 @@ object BindParameters extends ParameterizedQueryProcessor with QueryErrorsBase { | |||
// We should wait for `CTESubstitution` to resolve CTE before binding parameters, as CTE | |||
// relations are not children of `UnresolvedWith`. |
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'm thinking of a different approach: shall we explicitly match UnresolvedWith
here and bind parameters in the CTE relations? Then we no longer need this hack to delay parameter binding.
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.
Can we do that in 2 steps: 1. fix the issue, 2. do the proposed refactoring? It seems less risky, so, the first patch could be backported more safely.
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.
+1
Merging to master. Thank you, @srielau and @cloud-fan for review. |
We don't need to backport this fix to |
What changes were proposed in this pull request?
In the PR, I propose to postpone parameters resolution till
UnresolvedWithCTERelations
is resolved.Why are the changes needed?
To fix the query failure:
Does this PR introduce any user-facing change?
No.
How was this patch tested?
By running new test:
Was this patch authored or co-authored using generative AI tooling?
No.