[SPARK-57756][SQL][TESTS] Add buildSQLFunctionConf ANSI-invariant tests#57042
Open
daniel-lunin-db wants to merge 1 commit into
Open
[SPARK-57756][SQL][TESTS] Add buildSQLFunctionConf ANSI-invariant tests#57042daniel-lunin-db wants to merge 1 commit into
daniel-lunin-db wants to merge 1 commit into
Conversation
Add unit tests for Analyzer.buildSQLFunctionConf covering ANSI handling: a persisted ANSI value makes the alwaysSetAnsiValue flag a no-op, and the flag only takes effect when ANSI is not persisted (under ASSUME_ANSI_FALSE_IF_NOT_PERSISTED).
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add unit tests for Analyzer.buildSQLFunctionConf covering ANSI handling: a persisted ANSI value makes the alwaysSetAnsiValue flag a no-op, and the flag only takes effect when ANSI is not persisted (under ASSUME_ANSI_FALSE_IF_NOT_PERSISTED).
What changes were proposed in this pull request?
Add two unit tests in
AnalysisSuiteforAnalyzer.buildSQLFunctionConf, the helperthat constructs the throwaway
SQLConfused to resolve a SQL UDF body. The tests pinthe interaction between the
alwaysSetAnsiValueparameter and a SQL UDF's persistedANSI config:
spark.sql.ansi.enabledis persisted in the function's stored configs, thepersisted value wins and
alwaysSetAnsiValueis a no-op (checked with sessionoverrides both on and off).
alwaysSetAnsiValue=trueseeds it tofalse(viaASSUME_ANSI_FALSE_IF_NOT_PERSISTED) whilealwaysSetAnsiValue=falseleaves itunset.
Why are the changes needed?
buildSQLFunctionConfwas extracted in SPARK-57756 (#56895) but only had coveragethrough the existing end-to-end SQL UDF resolution tests. These add direct unit
coverage for the ANSI-seeding branch, which is the subtle part of the helper.
Does this PR introduce any user-facing change?
No. Tests only.
How was this patch tested?
New tests in
AnalysisSuite; CI runs them.Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Anthropic Claude Opus)