a10y commented on code in PR #8645:
URL: https://github.com/apache/arrow-rs/pull/8645#discussion_r2456339744


##########
arrow-select/src/take.rs:
##########
@@ -621,6 +627,58 @@ where
     Ok(GenericListArray::<OffsetType::Native>::from(list_data))
 }
 
+fn take_list_view<IndexType, OffsetType>(
+    values: &GenericListViewArray<OffsetType::Native>,
+    indices: &PrimitiveArray<IndexType>,
+) -> Result<GenericListViewArray<OffsetType::Native>, ArrowError>
+where
+    IndexType: ArrowPrimitiveType,
+    OffsetType: ArrowPrimitiveType,
+    OffsetType::Native: OffsetSizeTrait,
+{
+    // Take executes only over the views.
+    let mut taken_offsets: Vec<OffsetType::Native> = 
Vec::with_capacity(indices.len());
+    let mut taken_sizes: Vec<OffsetType::Native> = 
Vec::with_capacity(indices.len());
+
+    // Initialize null buffer
+    let num_bytes = bit_util::ceil(indices.len(), 8);
+    let mut null_buf = MutableBuffer::new(num_bytes).with_bitset(num_bytes, 
true);
+    let null_slice = null_buf.as_slice_mut();
+
+    for i in 0..indices.len() {

Review Comment:
   i slimmed this implementation down quite a lot using take_native and 
take_nulls, see comment below



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