Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
1f93a93
update
XiangpengHao Jul 1, 2025
2e01e56
update
XiangpengHao Jul 1, 2025
0bd08c3
update
XiangpengHao Jul 1, 2025
d6ecbd4
update
XiangpengHao Jul 1, 2025
7cd5518
cleanup
XiangpengHao Jul 2, 2025
4520048
update
XiangpengHao Jul 2, 2025
e6281bc
update
XiangpengHao Jul 2, 2025
6b6d4fc
update
XiangpengHao Jul 2, 2025
b696b66
update
XiangpengHao Jul 2, 2025
f60581f
update
XiangpengHao Jul 2, 2025
1851f0b
clippy and license
XiangpengHao Jul 2, 2025
5e414a8
Merge remote-tracking branch 'apache/main' into pushdown-v4
alamb Jul 7, 2025
58add51
bug fix
XiangpengHao Jul 8, 2025
470cc01
Merge remote-tracking branch 'refs/remotes/origin/pushdown-v3' into p…
XiangpengHao Jul 8, 2025
2bf3d38
clippy
XiangpengHao Jul 8, 2025
2cf1a8f
bug fix
XiangpengHao Jul 8, 2025
86e149c
switch to boolean array for row selection
XiangpengHao Jul 15, 2025
4d24172
Merge remote-tracking branch 'apache/main' into pushdown-v4
alamb Jul 15, 2025
be134d6
Add comments (OCD) and rename some fields
alamb Jul 15, 2025
eecaf99
Merge pull request #4 from alamb/alamb/pushdown_suggestions
XiangpengHao Jul 15, 2025
5537bcb
fmt
XiangpengHao Jul 15, 2025
b835163
fmt
alamb Jul 16, 2025
5132de8
Simplify projection caching
alamb Jul 16, 2025
253dad3
Move cache options construction to ArrayReaderBuilder, add builders
alamb Jul 16, 2025
5d9781e
update memory accounting
XiangpengHao Jul 17, 2025
2e20902
Merge remote-tracking branch 'refs/remotes/origin/pushdown-v4' into p…
XiangpengHao Jul 17, 2025
721d00c
Merge pull request #5 from alamb/alamb/simplify_cache
XiangpengHao Jul 17, 2025
f8aed80
Merge pull request #6 from alamb/alamb/cleaner_api
XiangpengHao Jul 17, 2025
884b591
update
XiangpengHao Jul 17, 2025
4f6b918
array size
XiangpengHao Jul 17, 2025
6c53bfd
add test case
XiangpengHao Jul 17, 2025
8ebe579
fix bug
XiangpengHao Jul 17, 2025
c240a52
clippy & fmt
XiangpengHao Jul 17, 2025
30a0d1c
Add config option for predicate cache memory limit
alamb Jul 23, 2025
ed3ce13
Add option to control predicate cache, documentation, ArrowReaderMetr…
alamb Jul 23, 2025
42d5520
Update parquet/src/arrow/arrow_reader/mod.rs
alamb Jul 24, 2025
6e618b3
Merge pull request #7 from alamb/alamb/test_memory_limit
XiangpengHao Jul 24, 2025
f70e46a
Clarify in documentation that cache is only for async decoder
alamb Jul 25, 2025
15d6826
add comment
alamb Jul 25, 2025
bec6d9c
Revert backwards incompatible changes to the Parquet reader API
alamb Jul 25, 2025
3e05cb2
Merge pull request #9 from alamb/alamb/revert_api_changes
XiangpengHao Jul 25, 2025
4d64dc0
Merge pull request #8 from alamb/alamb/pushdown-v4-cleanup
XiangpengHao Jul 25, 2025
8da582b
Merge remote-tracking branch 'apache/main' into pushdown-v4
alamb Aug 6, 2025
315e463
exclude nested column from cache
XiangpengHao Aug 7, 2025
1db701a
only use expanded selection when the column is one of cache column
XiangpengHao Aug 7, 2025
bea4433
Merge remote-tracking branch 'upstream/main' into pushdown-v4
XiangpengHao Aug 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions parquet/src/arrow/async_reader/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -635,12 +635,15 @@ where

// (pre) Fetch only the columns that are selected by the predicate
let selection = plan_builder.selection();
// Fetch predicate columns; expand selection only for cached predicate columns
let cache_mask = Some(&cache_projection);
row_group
.fetch(
&mut self.input,
predicate.projection(),
selection,
batch_size,
cache_mask,
)
.await?;

Expand Down Expand Up @@ -688,11 +691,13 @@ where
}
// fetch the pages needed for decoding
row_group
// Final projection fetch shouldn't expand selection for cache; pass None
.fetch(
&mut self.input,
&projection,
plan_builder.selection(),
batch_size,
None,
)
.await?;

Expand All @@ -718,12 +723,7 @@ where
cache_projection.intersect(projection);
self.exclude_nested_columns_from_cache(&cache_projection)
}
}

impl<T> ReaderFactory<T>
where
T: AsyncFileReader + Send,
{
/// Exclude leaves belonging to roots that span multiple parquet leaves (i.e. nested columns)
fn exclude_nested_columns_from_cache(&self, mask: &ProjectionMask) -> Option<ProjectionMask> {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New change 1: exclude nested column from cache.

Previous behavior: panic.

It's not impossible but very hard to support cache nested columns. We don't support it yet.

With this change, it will fallback to the old implementation, i.e., decode twice, but at least will not panic.

let schema = self.metadata.file_metadata().schema_descr();
Expand Down Expand Up @@ -984,10 +984,12 @@ impl InMemoryRowGroup<'_> {
projection: &ProjectionMask,
selection: Option<&RowSelection>,
batch_size: usize,
cache_mask: Option<&ProjectionMask>,
) -> Result<()> {
let metadata = self.metadata.row_group(self.row_group_idx);
if let Some((selection, offset_index)) = selection.zip(self.offset_index) {
let selection = selection.expand_to_batch_boundaries(batch_size, self.row_count);
let expanded_selection =
selection.expand_to_batch_boundaries(batch_size, self.row_count);
// If we have a `RowSelection` and an `OffsetIndex` then only fetch pages required for the
// `RowSelection`
let mut page_start_offsets: Vec<Vec<u64>> = vec![];
Expand All @@ -1012,7 +1014,15 @@ impl InMemoryRowGroup<'_> {
_ => (),
}

ranges.extend(selection.scan_ranges(&offset_index[idx].page_locations));
// Expand selection to batch boundaries only for cached columns
let use_expanded = cache_mask.map(|m| m.leaf_included(idx)).unwrap_or(false);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change 2: only expand the selection for the caching column, not other columns. This should improve the IO.

if use_expanded {
ranges.extend(
expanded_selection.scan_ranges(&offset_index[idx].page_locations),
);
} else {
ranges.extend(selection.scan_ranges(&offset_index[idx].page_locations));
}
page_start_offsets.push(ranges.iter().map(|range| range.start).collect());

ranges
Expand Down Expand Up @@ -1920,7 +1930,6 @@ mod tests {
assert_eq!(total_rows, 730);
}

#[ignore]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

#[tokio::test]
async fn test_in_memory_row_group_sparse() {
let testdata = arrow::util::test_util::parquet_test_data();
Expand Down