Jefffrey commented on code in PR #11209:
URL: https://github.com/apache/arrow-rs/pull/11209#discussion_r4267772838


##########
arrow-data/src/transform/mod.rs:
##########
@@ -843,6 +843,16 @@ impl<'a> MutableArrayData<'a> {
             ));
         }
 
+        if len == 0 {
+            return Ok(());
+        }
+
+        if matches!(&self.data.data_type, DataType::Union(fields, _) if 
fields.is_empty()) {

Review Comment:
   i simply ask that replies here are in your own words, and not pure LLM 
generation. if LLM generation is required (e.g. for translation purposes) at 
the very least this should be called out explicitly



##########
arrow-data/src/transform/union.rs:
##########
@@ -77,11 +77,11 @@ pub(super) fn extend_nulls_dense(
     let DataType::Union(fields, _) = &mutable.data_type else {
         unreachable!()
     };
-    let first_type_id = fields
-        .iter()
-        .next()
-        .expect("union must have at least one field")
-        .0;
+    let Some(first_type_id) = fields.iter().next().map(|(type_id, _)| type_id) 
else {

Review Comment:
   this should look for a field that has nullable = true, same as what 
https://github.com/apache/arrow-rs/pull/10994 does
   
   (same for below sparse version)



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