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


##########
arrow-select/src/take.rs:
##########
@@ -652,76 +652,161 @@ where
     OffsetType::Native: OffsetSizeTrait,
     PrimitiveArray<OffsetType>: From<Vec<OffsetType::Native>>,
 {
-    let list_offsets = values.value_offsets();
+    let src_offsets = values.value_offsets();
     let child_data = values.values().to_data();
     let nulls = take_nulls::<_, CHECKED>(values.nulls(), indices);
 
-    let mut new_offsets = Vec::with_capacity(indices.len() + 1);
-    new_offsets.push(OffsetType::Native::zero());
+    let mut dst_offsets = Vec::with_capacity(indices.len() + 1);
+    dst_offsets.push(OffsetType::Native::zero());
 
-    let use_nulls = child_data.null_count() > 0;
+    let field = values.value_field().clone();
+
+    let is_primitive_child = child_data.null_count() == 0 && 
child_data.data_type().is_primitive();
+
+    if is_primitive_child {
+        let values_buf = &child_data.buffers()[0];
+        let Some(bytes_per_value) = child_data.data_type().primitive_width() 
else {
+            unreachable!("is_primitive guarantees primitive_width is Some")
+        };

Review Comment:
   ```suggestion
       if child_data.null_count() == 0 && let Some(bytes_per_value) = 
child_data.data_type().primitive_width() {
           let values_buf = &child_data.buffers()[0];
   ```



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