Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-50322][SQL] Fix parameterized identifier in a sub-query
### 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: ```sql 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. Closes apache#48847 from MaxGekk/fix-parameter-subquery. Authored-by: Max Gekk <[email protected]> Signed-off-by: Max Gekk <[email protected]>
- Loading branch information