pingzh opened a new pull request, #7261:
URL: https://github.com/apache/datafusion-comet/pull/7261

   ## 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.
   
   ## Rationale for this change
   
   With ANSI enabled, `make_date(y, month(make_date(2024, m, 1)), 1)` must 
return NULL when `y` is NULL, even if `m` is 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?
   
   - Preserve year → month → day NULL checks using the existing short-circuit 
lowering, with fallback where shared subexpressions prevent preserving Spark 
evaluation.
   - Guard parents that can skip a date operand, including empty IN predicates, 
while retaining native execution for supported conditionals and eager date 
operands.
   - Return an empty native result for an empty input batch, so selected 
branches with scalar arguments do not validate an unevaluated date.
   - Document expression-level fallback behavior. Operator fallback and the 
Date32 overflow correction remain in the subsequent PRs.
   
   ## 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. They use existing ANSI invalid-month 
errors so this PR can land before the overflow correction. An inline Rust 
regression checks empty and nonempty batches containing scalar arguments.
   
   Full-reactor JVM and test-source compilation passes on Spark 4.1 / JDK 17, 
including formatting and style checks; Rust formatting also passes. Runtime 
execution is blocked because the configured native dependency registry does not 
contain the locked `aws-config 1.13.0` package. The `run-spark-4.1-tests` and 
`run-all-spark-profiles` CI labels should be applied before merging.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to