Commit e40dc30
[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>1 parent ad958d4 commit e40dc30
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 | | |
| |||
2695 | 2722 | | |
2696 | 2723 | | |
2697 | 2724 | | |
2698 | | - | |
2699 | | - | |
2700 | | - | |
2701 | | - | |
2702 | | - | |
| 2725 | + | |
| 2726 | + | |
| 2727 | + | |
| 2728 | + | |
2703 | 2729 | | |
2704 | 2730 | | |
2705 | 2731 | | |
| |||
3005 | 3031 | | |
3006 | 3032 | | |
3007 | 3033 | | |
3008 | | - | |
3009 | | - | |
3010 | | - | |
3011 | | - | |
3012 | | - | |
| 3034 | + | |
| 3035 | + | |
| 3036 | + | |
| 3037 | + | |
3013 | 3038 | | |
3014 | 3039 | | |
3015 | 3040 | | |
| |||
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