alamb commented on code in PR #7855:
URL: https://github.com/apache/arrow-rs/pull/7855#discussion_r2183235866


##########
arrow-array/src/array/union_array.rs:
##########
@@ -781,13 +781,23 @@ impl Array for UnionArray {
         };
 
         if fields.len() <= 1 {
-            return self
+            if let Some(logical_nulls) = self
                 .fields
                 .iter()
                 .flatten()
                 .map(Array::logical_nulls)
                 .next()
-                .flatten();
+                .flatten()
+            {
+                if logical_nulls.len() != self.len() {

Review Comment:
   it seems like this can only happen for Dense unions -- I think the code 
would be clearer if it it explicitly had two paths, one (the existing code) for 
dense unions and one for sparse unions
   
   



-- 
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...@arrow.apache.org

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

Reply via email to