[SPARK-51695][SQL][DOCS][FOLLOW-UP] Clarify NULL handling semantics in UNIQUE constraint Javadoc#54357
Open
yyanyy wants to merge 1 commit intoapache:masterfrom
Open
[SPARK-51695][SQL][DOCS][FOLLOW-UP] Clarify NULL handling semantics in UNIQUE constraint Javadoc#54357yyanyy wants to merge 1 commit intoapache:masterfrom
yyanyy wants to merge 1 commit intoapache:masterfrom
Conversation
…n UNIQUE constraint Javadoc Document NULLS DISTINCT behavior: NULL values are treated as distinct from each other, so rows with NULLs in unique columns never conflict. Also note that UNIQUE allows nullable columns (unlike PRIMARY KEY) and that NULLS NOT DISTINCT is not currently supported. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
| * if and only if no two rows in a table have the same non-null values in the unique columns. | ||
| * Unlike PRIMARY KEY, UNIQUE allows nullable columns. | ||
| * <p> | ||
| * NULL values are treated as distinct from each other (NULLS DISTINCT semantics). Two rows |
Member
There was a problem hiding this comment.
We don’t need to define the suggested behavior in Spark itself. The behavior can be left to the connector implementations.
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?
Document NULLS DISTINCT behavior: NULL values are treated as distinct from each other, so rows with NULLs in unique columns never conflict. Also note that UNIQUE allows nullable columns (unlike PRIMARY KEY) and that NULLS NOT DISTINCT is not currently supported.
Why are the changes needed?
Better javadoc clarity on UNIQUE constraint expectation.
Does this PR introduce any user-facing change?
No
How was this patch tested?
N/A
Was this patch authored or co-authored using generative AI tooling?
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com