feniljain commented on code in PR #16759:
URL: https://github.com/apache/datafusion/pull/16759#discussion_r2205550566


##########
datafusion/functions/src/datetime/make_date.rs:
##########
@@ -122,6 +122,12 @@ impl ScalarUDFImpl for MakeDateFunc {
 
         let [years, months, days] = take_function_args(self.name(), args)?;
 
+        if matches!(years, ColumnarValue::Scalar(ScalarValue::Null)) 
+            || matches!(months, ColumnarValue::Scalar(ScalarValue::Null))
+            || matches!(days, ColumnarValue::Scalar(ScalarValue::Null)) {
+            return Ok(ColumnarValue::Scalar(ScalarValue::Null));
+        }

Review Comment:
   Suggested change when applied, compiler asks me to convert it to something 
like this:
   ```
       if [years.clone(), months.clone(), days.clone()].iter().any(|v| 
matches!(v, ColumnarValue::Scalar(ScalarValue::Null))) {
               return Ok(ColumnarValue::Scalar(ScalarValue::Null));
        }
   ```
   
   this will `clone` the Scalar values, is that acceptable?



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to