feat(parquet): support configurable bitmap row-range refining strategies (coalesce and trim)#424
Merged
Merged
Conversation
…ousBatchFirstRowId to GetGlobalRowId
lxy-9602
reviewed
Jul 18, 2026
zhf999
force-pushed
the
paged-bitmap-coalesce
branch
from
July 20, 2026 07:23
8c8fd0e to
d18898a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(parquet): support configurable bitmap row-range refining strategies (coalesce and trim)
Purpose
Previously, when a bitmap was pushed down for page-level filtering, the only strategy was to trim page start/end rows based on the bitmap and then apply intersection across all target columns (
FilterPagesByBitmap). While precise, this approach can produce many small disjoint ranges when the bitmap has scattered set bits, leading to excessive range count and degraded I/O efficiency.This PR introduces two configurable strategies for refining row ranges from a pushed-down bitmap:
Coalesce strategy (default): Converts bitmap set bits into contiguous row ranges per row group via
BitmapToContiguousRanges, then merges nearby ranges whose inter-range gap is ≤coalesce-hole-size-limit(default 32) viaCoalesceNearbyRanges. This reduces the number of disjoint ranges while still skipping large holes, improving I/O efficiency by trading a small amount of over-read for fewer range seeks.Trim strategy (existing behavior, renamed): The previous
FilterPagesByBitmapapproach is renamed toRefineRowRangesByTrimming. It trims page start/end rows based on the bitmap and applies intersection among all target columns, providing the most precise range selection without over-reading.The strategy is selected at runtime via the new option
parquet.read.bitmap.row-range-refining-strategy(values:"coalesce"or"trim"; default:"coalesce").Tests
UT —
PageFilteredRowGroupReaderTest(src/paimon/format/parquet/page_filtered_row_group_reader_test.cpp):BitmapCoalesceTest(replacesScatteredBitmapTest) — verifies that the coalesce strategy merges ranges with gaps ≤ 32, producing 143 rows from a bitmap of 111 set bits across 4 ranges.BitmapCoalesceSmallHoleSizeTest(new) — verifies that a smallcoalesce-hole-size-limit(5) prevents merging ranges with larger gaps, producing exactly 111 rows (no holes filled).BitmapTrimStrategyTest(new) — verifies the trim strategy produces 84 rows by trimming page boundaries without coalescing.BitmapWithPageFilteredOptionDisabled— updated to use the newoptions-based test helper signature.Test helper
ReadWithPredicateAndBitmapImplwas refactored: thebool enable_page_level_filterparameter is replaced withconst std::map<std::string, std::string> options, allowing test cases to pass arbitrary reader options (strategy, hole size limit, page index filter toggle, etc.).Datasets
Multiple performance testing were conducted on 2 dataset.
Test Methodology
To validate bitmap behavior, we organize tests into six groups based on bitmap distribution patterns. Each group contains five distinct datasets, and the final result reported is the average of these five runs.
Test Cases
1010101010...).Test Results
On dataset1
On dataset2
Perf tests on 2 datasets shows the Coalesce strategy has better performance on Case 7, Case 8, Case 10 and Case 11.
API and Format
parquet_file_batch_reader.h:FilterPagesByBitmaprenamed toRefineRowRangesByTrimming.FilterRowGroupPagesByBitmaprenamed toTrimRowGroupPageRanges.RefineRowRangesByCoalescing,BitmapToContiguousRanges,CoalesceNearbyRanges.parquet_format_defs.h:PARQUET_READ_BITMAP_ROW_RANGE_REFINING_STRATEGY="parquet.read.bitmap.row-range-refining-strategy"(default:"coalesce").PARQUET_READ_ROW_RANGES_COALESCE_HOLE_SIZE_LIMIT="parquet.read.bitmap.coalesce-hole-size-limit"(default:32).include/.Documentation
No new user-facing feature documentation needed — this is an internal performance optimization configurable via reader options.
Generative AI tooling
GLM 5.2.