sdf-jkl commented on issue #8847:
URL: https://github.com/apache/arrow-rs/issues/8847#issuecomment-3916465479
It seems like the #8733 implementation is the same as one in #6624.
Impls respectively:
```rust
fn boolean_mask_from_selectors(selectors: &[RowSelector]) -> BooleanBuffer {
let total_rows: usize = selectors.iter().map(|s| s.row_count).sum();
let mut builder = BooleanBufferBuilder::new(total_rows);
for selector in selectors {
builder.append_n(selector.row_count, !selector.skip);
}
builder.finish()
}
```
```rust
impl From<RowSelection> for BooleanRowSelection {
fn from(selection: RowSelection) -> Self {
let total_rows = selection.row_count();
let mut builder = BooleanBufferBuilder::new(total_rows);
for selector in selection.iter() {
if selector.skip {
builder.append_n(selector.row_count, false);
} else {
builder.append_n(selector.row_count, true);
}
}
BooleanRowSelection {
selector: builder.finish(),
}
}
}
```
--
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]