Rich-T-kid commented on code in PR #10812:
URL: https://github.com/apache/arrow-rs/pull/10812#discussion_r3873466054
##########
arrow-select/src/take.rs:
##########
@@ -652,76 +651,142 @@ 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(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 bytes_per_value = if !child_data.is_empty() {
Review Comment:
yea this is cleaner
--
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]