[SPARK-56652][SQL] Always emit RELY/NORELY in DESCRIBE EXTENDED constraint output #55590
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.39) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 260 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.333
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #55590"
general
weight: 0.35
yyanyy
What changes were proposed in this pull request?
BaseConstraint.toDescription()now always emitsRELY|NORELY, matchingtoDDL()used by SHOW CREATE TABLE. Previously,toDescription()skipped theNORELYtoken whenrely=false, so the same constraint rendered differently across the two surfaces.After this change, the invariant holds:
toDDLis"CONSTRAINT " + name + " " + toDescription.Why are the changes needed?
After SPARK-52141 (DESCRIBE EXTENDED) and SPARK-52142 (SHOW CREATE TABLE) landed, the two surfaces render the same constraint asymmetrically:
| State | DESCRIBE EXTENDED (before) | SHOW CREATE TABLE |
|--------------|-----------------------------------|-------------------------------------|
| PK default | PRIMARY KEY (a) NOT ENFORCED | PRIMARY KEY (a) NOT ENFORCED NORELY |
| CHECK default| CHECK (...) ENFORCED | CHECK (...) ENFORCED NORELY |
The original review on PR #51577 considered skipping both
NOT ENFORCEDandNORELYwhen default, but onlyNORELYwas skipped becauseENFORCED's default is per-subclass and not visible toBaseConstraint. The result is a confusing experience: SHOW CREATE TABLE reports the rely state explicitly while DESCRIBE EXTENDED hides it for the default value.Does this PR introduce any user-facing change?
Slight output change in DESCRIBE EXTENDED command output. DESCRIBE EXTENDED now emits
NORELYfor constraints whoserelyvalue is the default. PRIMARY KEY / UNIQUE / FOREIGN KEY / CHECK constraints all show the fullENFORCED|NOT ENFORCED RELY|NORELYsuffix, matching SHOW CREATE TABLE.How was this patch tested?
Updated golden strings in the v2
DescribeTableSuite"desc table constraints" test. Ran:build/sbt 'sql/testOnly \
org.apache.spark.sql.execution.command.v2.DescribeTableSuite \
org.apache.spark.sql.execution.command.v2.ShowCreateTableSuite'
41 tests pass.
Was this patch authored or co-authored using generative AI tooling?
Claude Opus 4.7