Commit 477d916
[SPARK-57756][SQL] Move SQL UDF resolution SQLConf construction to common code
SessionCatalog.makeSQLFunctionPlan and the ResolveSQLFunctions / ResolveSQLTableFunctions analyzer rules each inline the same throwaway-SQLConf construction used to resolve a SQL UDF body: new SQLConf, seed from the function's stored configs, then either set ANSI unconditionally or overlay the session's retained resolution configs. Move it into a common Analyzer.buildSQLFunctionConf helper, parameterized by alwaysSetAnsiValue and applySessionOverrides, and have the three call sites delegate to it. Behavior-preserving.
### What changes were proposed in this pull request?
`SessionCatalog.makeSQLFunctionPlan` and the `ResolveSQLFunctions` /
`ResolveSQLTableFunctions` analyzer rules each inline the same throwaway-`SQLConf`
construction used to resolve a SQL UDF body. This moves it into a common
`Analyzer.buildSQLFunctionConf` helper, parameterized by `alwaysSetAnsiValue` and
`applySessionOverrides`, and has the three call sites delegate to it.
### Why are the changes needed?
The three call sites carried the same conf-seeding logic. Unifying it removes the
duplication and gives one place to reason about a SQL UDF body's resolution conf.
### Does this PR introduce _any_ user-facing change?
No. The helper produces the same `SQLConf` the inline code did.
### How was this patch tested?
Behavior-preserving extraction, covered by existing SQL UDF resolution tests; CI on
this PR compiles and runs them.
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Anthropic Claude Opus)
Closes #56895 from daniel-lunin-db/SPARK-57756.
Authored-by: daniel-lunin-db <daniel.lunin@databricks.com>
Signed-off-by: Max Gekk <max.gekk@gmail.com>
(cherry picked from commit e40dc30)
Signed-off-by: Max Gekk <max.gekk@gmail.com>1 parent 6a03aac commit 477d916
2 files changed
Lines changed: 39 additions & 13 deletions
File tree
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst
- analysis
- catalog
Lines changed: 35 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
327 | 327 | | |
328 | 328 | | |
329 | 329 | | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
330 | 357 | | |
331 | 358 | | |
332 | 359 | | |
| |||
2700 | 2727 | | |
2701 | 2728 | | |
2702 | 2729 | | |
2703 | | - | |
2704 | | - | |
2705 | | - | |
2706 | | - | |
2707 | | - | |
| 2730 | + | |
| 2731 | + | |
| 2732 | + | |
| 2733 | + | |
2708 | 2734 | | |
2709 | 2735 | | |
2710 | 2736 | | |
| |||
3010 | 3036 | | |
3011 | 3037 | | |
3012 | 3038 | | |
3013 | | - | |
3014 | | - | |
3015 | | - | |
3016 | | - | |
3017 | | - | |
| 3039 | + | |
| 3040 | + | |
| 3041 | + | |
| 3042 | + | |
3018 | 3043 | | |
3019 | 3044 | | |
3020 | 3045 | | |
| |||
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1893 | 1893 | | |
1894 | 1894 | | |
1895 | 1895 | | |
1896 | | - | |
1897 | | - | |
1898 | | - | |
| 1896 | + | |
| 1897 | + | |
| 1898 | + | |
| 1899 | + | |
1899 | 1900 | | |
1900 | 1901 | | |
1901 | 1902 | | |
| |||
0 commit comments