fix: preserve make_date argument and parent evaluation #7261
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 348 lines diff across 4 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.350
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #7261"
general
weight: 0.35
sunchao
Which issue does this PR close?
Part of #6741. Second of four smaller changes replacing #7117; the issue stays open for operator evaluation and Date32 overflow fixes. The independent identity-broadcast fix is #7260; this PR targets main directly.
Rationale for this change
With ANSI enabled,
make_date(y, month(make_date(2024, m, 1)), 1)must return NULL whenyis NULL, even ifmis 13. Eager native evaluation can evaluate the invalid inner date before checking the outer year. Parent expressions can likewise skip a date operand that native evaluation would evaluate.What changes are included in this PR?
How are these changes tested?
Existing SQL and Scala fixtures cover NULL-skipped arguments, required argument errors, shared subexpressions, conditional parents, eager date operands, and empty IN/InSet predicates. Nonempty IN regressions cover native safe candidates, throwing scalar and struct candidates, NOT IN, NULL probes, and required-candidate errors. The JVM tests check both interpreted and generated Spark evaluation for the mixed-row first-match example. They use existing ANSI invalid-month errors so this PR can land before the overflow correction. Inline Rust regressions cover invalid scalar dates and throwing ANSI casts in each argument position, on empty and nonempty batches, with and without NULL short-circuiting.
Full-reactor JVM and test-source compilation passes on Spark 4.1 / JDK 17, including formatting and style checks; Rust formatting also passes. All six tests in QueryPlanSerdeSuite pass. The computed-candidate regression fails before the fix and passes afterward. Local Rust and native SQL test execution remain blocked because the configured native dependency registry does not contain the locked
aws-config 1.13.0package. A maintainer must apply therun-spark-4.1-testsandrun-all-spark-profilesCI labels before merging; the author account lacks permission to add them.