[SPARK-58212][SQL] Replace _LEGACY_ERROR_TEMP_1052 with UNSUPPORTED_FEATURE.TABLE_OPERATION#57364
Open
Ma77Ball wants to merge 2 commits into
Open
[SPARK-58212][SQL] Replace _LEGACY_ERROR_TEMP_1052 with UNSUPPORTED_FEATURE.TABLE_OPERATION#57364Ma77Ball wants to merge 2 commits into
Ma77Ball wants to merge 2 commits into
Conversation
uros-b
approved these changes
Jul 20, 2026
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.
What changes were proposed in this pull request?
This PR assigns a name to the legacy error condition
_LEGACY_ERROR_TEMP_1052, raised when aNOT NULLcolumn is added to a v1 (session-catalog) table viaALTER TABLE ... ADD COLUMN. Rather than introducing a brand-new condition, it reuses the existingUNSUPPORTED_FEATURE.TABLE_OPERATION, matching the sibling "ADD COLUMN with qualified column" rejection immediately above the same call site inResolveSessionCatalog. Concretely: removed_LEGACY_ERROR_TEMP_1052fromerror-conditions.json; removed the now-unusedaddColumnWithV1TableCannotSpecifyNotNullError()helper fromQueryCompilationErrors; and changed the call site to throwunsupportedTableOperationError(ident, "ADD COLUMN with NOT NULL").Why are the changes needed?
This is part of the ongoing effort under SPARK-37935 to migrate
_LEGACY_ERROR_TEMP_*conditions onto proper, named error classes. ReusingUNSUPPORTED_FEATURE.TABLE_OPERATIONkeeps the twoADD COLUMNrejections at this call site consistent and yields a clearer, table-qualified message.Does this PR introduce any user-facing change?
Yes. The error condition name and message change; the behavior (the conditions under which the error is raised) is unchanged.
Before (condition
_LEGACY_ERROR_TEMP_1052):After (condition
UNSUPPORTED_FEATURE.TABLE_OPERATION):How was this patch tested?
Added a new
checkErrortest inQueryCompilationErrorsSuitethat runsALTER TABLE t ADD COLUMN c INT NOT NULLon a v1 parquet table and asserts theUNSUPPORTED_FEATURE.TABLE_OPERATIONcondition and its parameters. No test previously covered this path.Was this patch authored or co-authored using generative AI tooling?
No