fix(scan): prune data-evolution files by projection - #442
Merged
Conversation
Propagate DataFusion projections into scan planning so data-evolution tables can drop physical files whose write columns are not needed by the read type. Resolve projection matches by stable field id across schema evolution, keep row-count representatives for empty or sidecar-only matches, and retain the normal anchor needed by deletion-vector planning. Signed-off-by: QuakeWang <wangfuzheng0814@foxmail.com>
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.
Purpose
DataFusion projections were only applied at read time. For data-evolution tables, scan planning still kept every physical file in a row-id group even when the projected read type did not need the columns written by some files.
This made projection pruning ineffective for data-evolution planning and could keep unnecessary sidecar/partial-column files in planned splits.
Brief change log
ReadBuilder::new_scan().(schema_id, write_cols)field-id resolution during scan planning.Tests
cargo test -p paimon --all-targets --features fulltext,vortex,mosaic table::table_scan::tests::test_data_evolution_pruningcargo test -p paimon --all-targets --features fulltext,vortex,mosaic table::read_builder::tests::test_new_scan_validates_unknown_projectioncargo test -p paimon-datafusion --all-targets test_scan_applies_projection_to_data_evolution_planningAPI and Format
Documentation