Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

MaxGekk
Copy link
Member

@MaxGekk MaxGekk commented Nov 14, 2024

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:

execute immediate 'with v1 as (select * from tt1 where 1 = (Select * from identifier(:tab))) select * from v1' using 'tt1' as tab;
[UNBOUND_SQL_PARAMETER] Found the unbound parameter: tab. Please, fix `args` and provide a mapping of the parameter to either a SQL literal or collection constructor functions such as `map()`, `array()`, `struct()`. SQLSTATE: 42P02

Does this PR introduce any user-facing change?

No.

How was this patch tested?

By running new test:

$ build/sbt "sql/test:testOnly org.apache.spark.sql.ParametersSuite

Was this patch authored or co-authored using generative AI tooling?

No.

@github-actions github-actions bot added the SQL label Nov 14, 2024
@MaxGekk MaxGekk changed the title [WIP] Fix parameterized identifier in a sub-query [SPARK-50322][SQL] Fix parameterized identifier in a sub-query Nov 14, 2024
@MaxGekk MaxGekk marked this pull request as ready for review November 14, 2024 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants