gstvg commented on code in PR #22158:
URL: https://github.com/apache/datafusion/pull/22158#discussion_r3238913832
##########
datafusion/common/src/utils/mod.rs:
##########
@@ -1142,17 +1141,18 @@ fn truncate_list_nulls<O: OffsetSizeTrait>(
&Int64Array::new_scalar(0)
};
- let not_empty = neq(&lengths, zero)?;
- let null_and_non_empty = &!nulls.inner() & not_empty.values();
+ let empty = arrow::compute::kernels::cmp::eq(&lengths, zero)?;
+ let valid_or_empty = empty.values() | nulls.inner();
+ let valid_or_empty = BooleanArray::from(valid_or_empty);
Review Comment:
[BooleanArray::has_false](https://github.com/apache/arrow-rs/blob/1ffd202aeef1af2a3b0ab2b4ae604a9edbac6e09/arrow-array/src/array/boolean_array.rs#L224)
used below I believe has no performatic `BooleanBuffer` equivalent:
`.iter().any(|v| !v)` checks bit for bit (as a future improvement, the non-null
branch could be moved to `BooleanBuffer`). But that [BooleanArray::from
BooleanBuffer should be cheap
anyway](https://github.com/apache/arrow-rs/blob/1ffd202aeef1af2a3b0ab2b4ae604a9edbac6e09/arrow-array/src/array/boolean_array.rs#L878-L885).
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]