-
Notifications
You must be signed in to change notification settings - Fork 28.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-51247][SQL] Move SubstituteExecuteImmediate to 'resolution' ba…
…tch and prepare it for SQL Scripting local variables ### What changes were proposed in this pull request? This PR changes `SubstituteExecuteImmediate` to analyze it's entire subtree within a scoped context. This will allow us to disable SQL scripting local variables in the subtree, when they are added, which is necessary in order to sandbox the generated plan. This PR also moves `SubstituteExecuteImmediate` to `resolution` batch in the analyzer. This is necessary in order to resolve arguments of EXECUTE IMMEDIATE properly, notably if the EXECUTE IMMEDIATE is the child of a `ParameterizedQuery`. This ensured proper resolution ordering i.e. first all parameters of EXECUTE IMMEDIATE will be resolved, and only then will the generated query itself be analyzed. Local variables PR - #49445 ### Why are the changes needed? They are necessaty for local variables support in SQL scripting. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Existing unit tests and golden files. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #49993 from dusantism-db/execute-immediate-resolution-batch. Authored-by: Dušan Tišma <dusan.tisma@databricks.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com> (cherry picked from commit 26febf7) Signed-off-by: Wenchen Fan <wenchen@databricks.com>
- Loading branch information
1 parent
db6c1d0
commit d0a7db4
Showing
2 changed files
with
47 additions
and
19 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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