comphead commented on code in PR #8381:
URL: https://github.com/apache/arrow-datafusion/pull/8381#discussion_r1411330070


##########
datafusion/physical-expr/src/array_expressions.rs:
##########
@@ -1515,32 +1515,33 @@ pub fn array_union(args: &[ArrayRef]) -> 
Result<ArrayRef> {
     }
     let array1 = &args[0];
     let array2 = &args[1];
+
+    fn union_arrays<O: OffsetSizeTrait>(
+        array1: &ArrayRef,
+        array2: &ArrayRef,
+        l_field_ref: &Arc<Field>,
+        r_field_ref: &Arc<Field>,
+    ) -> Result<ArrayRef> {
+        match (l_field_ref.data_type(), r_field_ref.data_type()) {
+            (DataType::Null, _) => Ok(array2.clone()),

Review Comment:
   Awesome @Weijun-H 
   Makes the code cleaner
   
   Its not a problem of this PR but I'm thinking why we need to clone arrays in 
case of nulls....  🤔 



##########
datafusion/physical-expr/src/array_expressions.rs:
##########
@@ -1515,32 +1515,33 @@ pub fn array_union(args: &[ArrayRef]) -> 
Result<ArrayRef> {
     }
     let array1 = &args[0];
     let array2 = &args[1];
+
+    fn union_arrays<O: OffsetSizeTrait>(
+        array1: &ArrayRef,
+        array2: &ArrayRef,
+        l_field_ref: &Arc<Field>,
+        r_field_ref: &Arc<Field>,
+    ) -> Result<ArrayRef> {
+        match (l_field_ref.data_type(), r_field_ref.data_type()) {
+            (DataType::Null, _) => Ok(array2.clone()),

Review Comment:
   Awesome @Weijun-H 
   Makes the code cleaner
   
   Its not a problem of this PR but I'm thinking why we need to clone arrays in 
case of nulls....  🤔 



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