alamb commented on code in PR #9118:
URL: https://github.com/apache/arrow-rs/pull/9118#discussion_r2729049865
##########
parquet/src/arrow/arrow_reader/read_plan.rs:
##########
@@ -307,6 +342,8 @@ pub struct ReadPlan {
batch_size: usize,
/// Row ranges to be selected from the data source
row_selection_cursor: RowSelectionCursor,
+ /// Precomputed page boundary row indices for mask chunking
+ page_boundaries: Option<Arc<[usize]>>,
Review Comment:
I have been digging around -- and I think the `page_start_boundaries` which
is already calculated might be what we need. I will see if I can find some way
to reuse it
##########
parquet/src/arrow/arrow_reader/mod.rs:
##########
@@ -5661,12 +5668,235 @@ pub(crate) mod tests {
.build()
.unwrap();
- // Predicate pruning used to panic once mask-backed plans removed
whole pages.
- // Collecting into batches validates the plan now downgrades to
selectors instead.
let schema = reader.schema().clone();
let batches = reader.collect::<Result<Vec<_>, _>>().unwrap();
let result = concat_batches(&schema, &batches).unwrap();
assert_eq!(result.num_rows(), 2);
+ assert_eq!(
+ result.column(0).as_ref(),
+ &Int64Array::from(vec![first_value, last_value])
+ );
+ assert_eq!(
+ result.column(1).as_ref(),
+ &Int64Array::from(vec![first_value, last_value])
+ );
+ }
+
+ /// Test that bitmask-based row selection correctly handles page
boundaries.
+ /// This test creates a parquet file with multiple small pages and
verifies that
+ /// when using Mask policy, pages that are skipped entirely are handled
correctly.
+ #[test]
+ fn test_bitmask_page_aware_selection() {
Review Comment:
I think as a follow on we should maybe split up the tests as well, as
described here
- https://github.com/apache/arrow-rs/issues/9269
##########
parquet/src/arrow/arrow_reader/read_plan.rs:
##########
@@ -307,6 +342,8 @@ pub struct ReadPlan {
batch_size: usize,
/// Row ranges to be selected from the data source
row_selection_cursor: RowSelectionCursor,
+ /// Precomputed page boundary row indices for mask chunking
+ page_boundaries: Option<Arc<[usize]>>,
Review Comment:
https://github.com/apache/arrow-rs/blob/3d5428da8478e8a74fa8fca3adbe1cb2166b5de5/parquet/src/arrow/in_memory_row_group.rs#L47-L46
--
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]