alamb commented on code in PR #11206:
URL: https://github.com/apache/arrow-rs/pull/11206#discussion_r4123025019
##########
arrow-select/src/filter.rs:
##########
@@ -254,10 +305,40 @@ pub struct FilterBuilder {
impl FilterBuilder {
/// Create a new [`FilterBuilder`] that can be used to construct a
[`FilterPredicate`]
pub fn new(filter: &BooleanArray) -> Self {
- Self::new_with_count(filter, filter.true_count())
+ // SAFETY: the count is computed from `filter` itself.
+ unsafe { Self::new_with_count(filter, filter.true_count()) }
}
- pub(crate) fn new_with_count(filter: &BooleanArray, count: usize) -> Self {
+ /// Create a new [`FilterBuilder`] from a mask whose number of selected
rows
Review Comment:
> > actually, then that would be a public API change so that is probably not
ok to do yet
>
> Would it count as one? I think it should be okay, no?
Actually, no I don't think so -- for some reason I thought FilterBuilder:new
took a row count already -- but I reviewed the existing docs and it does not:
https://docs.rs/arrow/60.0.0/arrow/compute/struct.FilterBuilder.html
--
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]