jayzhan211 commented on code in PR #7207:
URL: https://github.com/apache/arrow-datafusion/pull/7207#discussion_r1285140744


##########
datafusion/physical-expr/src/array_expressions.rs:
##########
@@ -327,21 +363,34 @@ fn array(values: &[ColumnarValue]) -> 
Result<ColumnarValue> {
         })
         .collect();
 
-    let mut data_type = DataType::Null;
+    let mut data_type = None;
     for arg in &arrays {
         let arg_data_type = arg.data_type();
         if !arg_data_type.equals_datatype(&DataType::Null) {
-            data_type = arg_data_type.clone();
+            data_type = Some(arg_data_type.clone());
             break;
+        } else {
+            data_type = Some(DataType::Null);
         }
     }
 
     match data_type {
-        DataType::Null => Ok(ColumnarValue::Scalar(ScalarValue::new_list(
+        None => Ok(ColumnarValue::Scalar(ScalarValue::new_list(
             Some(vec![]),
             DataType::Null,
         ))),
-        _ => Ok(ColumnarValue::Array(array_array(
+        Some(DataType::Null) => {

Review Comment:
   @izveigor , duckdb consider make_array(array[]) and make_array(array[null]) 
difference things, but in datafusion we both get `Scalar(List([NULL]))` in 
`make_scalar_function_with_hints` args. Do you know where can we change the 
args we get before create_physical_expr?



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

Reply via email to