Repository navigation
[core] Prune merged Data Evolution reads with Parquet statistics - #1469
SteNicholas wants to merge 2 commits into
Conversation
2c72193 to
276ea60
Compare
JingsongLi
left a comment
There was a problem hiding this comment.
Shared row ranges have end-to-end value. The earlier undersized-page case now falls back. Locally, 46 integration tests, eight candidate-range cases and 102 Parquet tests passed. The selective benchmark returned the same row and reduced column data reads from 2,342,012 bytes to 756. Two additional probes exposed the cases below.
b6d1080 to
789b8d6
Compare
270508e to
05bb9b7
Compare
05bb9b7 to
5137483
Compare
|
@JingsongLi, I reran the four regression tests for the cases you reported after rebasing
|
JingsongLi
left a comment
There was a problem hiding this comment.
Shared Parquet statistics can reduce the work needed for selective Data Evolution reads. The merged-reader and Parquet suites passed locally on aaa35f6f, and the earlier offset-only fallback preserved data-page reads in the new probe. I reproduced a separate cold-read I/O regression below.
edc2753 to
03980db
Compare
|
Thanks for checking the earlier fallback and reproducing the cold-read regression. The force-pushed commit keeps sparse reads on the The same commit updates Parquet to |
JingsongLi
left a comment
There was a problem hiding this comment.
The shared selection has end-to-end value for selective merged reads. The full core suite passed 5,112 tests locally. The earlier footer-decidable sparse reads, page alignment and optional-index fallback cases pass on this head. An additional counting-I/O test reproduced the point-read regression below.
|
Thanks for rerunning the core suite and reproducing the point-read regression, @JingsongLi. The follow-up keeps a single selected row on the On the 100,000-row fixture with a 49-column rating provider, |
Selective filters can leave a Data Evolution merge decoding entire column files. Column updates can leave stale values in older files, and Parquet pages can start at different rows across providers. A shared row-ID selection keeps the current values aligned during the merge. - Prune row groups and pages with statistics from the current provider of every field in a conjunct, addressing apache#1445. - Intersect candidates with caller ranges and bitmap hits, exclude deleted rows, and apply the full filter to reconstructed rows before LIMIT. - Reuse Parquet metadata and validate projected page row counts. Skip column indexes when footer statistics settle a sparse selection, and retry failed indexed reads from whole column chunks. - Enable pruning by default for row-tracked, unbucketed Data Evolution tables using Java's data-evolution.merged-read.stats-pushdown.enabled option. Benchmark selective and full-range reads.
Use the existing sparse read and merged residual for a single selected row when its Parquet row-group statistics are inconclusive. Loading the entire ColumnIndex for a point can cost more than reading the selected pages. Cover matching and rejected points with cold I/O assertions for both data-page and total bytes.
942195a to
1646549
Compare
|
Ping @JingsongLi. |
JingsongLi
left a comment
There was a problem hiding this comment.
The shared selection has end-to-end value. On 1646549b integrated with ebcff9f1, 39 table integration tests and 14 candidate-selection tests passed. The local cold-metadata selective benchmark returned the same result and reduced total reads from 3,390,588 to 1,157,808 bytes. Two additional read cases reproduced the issues below.
| winning_ids.contains(&field.id()) | ||
| && supports_stats(field.data_type()) | ||
| && !self.partition_fields.iter().any(|p| p.id() == field.id()) | ||
| && stats_evolution_is_safe(file_fields[i].data_type(), field.data_type()) |
There was a problem hiding this comment.
[P1] Use the effective read type when deciding whether bounds can prune. I read a merged Parquet split containing rating INT = 2117 through with_read_type with the same field ID projected as TINYINT, and applied the table predicate rating = 69. With merged statistics disabled, the normal reader narrows 2117 to 69 and returns row 2117. With the new pruning enabled, the scan returns no rows. The statistics check compares the physical field with the table field and skips the non-order-preserving conversion to the actual provider read type. Bypass stats for predicates on a field whose effective read conversion can change the comparison, and cover explicit read types in the merged-split regression.
| // For a single selected row, read its pages with the OffsetIndex and | ||
| // let the merged residual filter decide whether the row matches. | ||
| RowGroupMatch::Unknown => { | ||
| !indexed_selection.is_some_and(|filter| filter.span.from() == filter.span.to()) |
There was a problem hiding this comment.
[P2] Keep offset-only I/O for a tiny range inside one data page. On the 100,000-row fixture with 49 rating-provider columns and 64 rows per page, I explicitly selected rows 2117–2118 and filtered rating >= 2117. Both rows survived with pruning on and off. The enabled read fetched 3,159,015 bytes versus 1,939,935 bytes, and column-data reads rose from 450 to 3,595 bytes. The inconclusive-footer fallback only handles exactly one row, even when both selected rows fit on one page. Consider the selection and index costs before fetching the ColumnIndex, and let the residual check a tiny selected range.
Purpose
Closes #1445.
Selective filters can leave a Data Evolution merge decoding entire column files. Use Parquet statistics from the current column providers to build a shared row-ID selection and keep values aligned across files with different page boundaries.
Brief change log
LIMIT.ColumnIndexif the footer proves that every row matches or none can match. If an optionalColumnIndexfails to decode, retry theOffsetIndexusing the metadata bytes already fetched.Tests
cargo fmt --all -- --checkandgit diff --checkpassed.Benchmark
Both settings returned identical results. The table reports medians from seven runs with alternating execution order and the shared metadata cache disabled.
API and Format
The Java-compatible
data-evolution.merged-read.stats-pushdown.enabledoption defaults totrue. It applies to row-tracked, unbucketed Data Evolution append tables whose ordinary Parquet files share a complete row-ID range. Both settings read the existing storage format.Documentation
🤖 Assisted with Codex.