pingzh commented on code in PR #7261:
URL: https://github.com/apache/datafusion-comet/pull/7261#discussion_r4392545686


##########
native/spark-expr/src/datetime_funcs/make_date.rs:
##########
@@ -119,6 +119,11 @@ impl ScalarUDFImpl for SparkMakeDate {
     fn invoke_with_args(&self, args: ScalarFunctionArgs) -> 
Result<ColumnarValue> {
         let [year, month, day] = take_function_args(self.name(), args.args)?;
 
+        // Scalar arguments must not evaluate a date when the input batch has 
no rows.
+        if args.number_rows == 0 {

Review Comment:
   Fixed in 6ff7d1fbe. The zero-row check now wraps the physical make_date 
expression, before child evaluation, and applies even when NULL 
short-circuiting is disabled or its wrapper is optimized away. Inline 
regressions cover throwing casts in all three argument positions: empty batches 
should return an empty Date32 array, while nonempty batches must still raise 
CAST_INVALID_INPUT. Formatting and diff checks pass; local Rust test execution 
is blocked by the configured registry missing the locked aws-config 1.13.0 
dependency.



-- 
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