onursatici commented on code in PR #6779:
URL: https://github.com/apache/arrow-rs/pull/6779#discussion_r1860467354


##########
arrow-select/src/interleave.rs:
##########
@@ -231,6 +235,39 @@ fn interleave_dictionaries<K: ArrowDictionaryKeyType>(
     Ok(Arc::new(array))
 }
 
+fn interleave_views<T: ByteViewType>(
+    values: &[&dyn Array],
+    indices: &[(usize, usize)],
+) -> Result<ArrayRef, ArrowError> {
+    let interleaved = Interleave::<'_, GenericByteViewArray<T>>::new(values, 
indices);
+    let mut views_builder = BufferBuilder::new(indices.len());
+    let mut buffers = Vec::with_capacity(values[0].len());
+
+    let mut buffer_lookup = HashMap::new();

Review Comment:
   I see, I have filed https://github.com/apache/arrow-rs/pull/6808 to 
deduplicate the buffers while building the interleaved array in the fallback 
implementation.
   
   I am not sure if that would completely remove the need for this PR though, 
it should guarantee that no duplicate buffers should exist on the interleaved 
array, but the fallback implementation would still have 2 buffers in the test 
below, because those two buffers are unique. It feels like this PR and #6808 
are complementary



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