feat(table): support column projection in ReadBuilder#153
Open
QuakeWang wants to merge 1 commit intoapache:mainfrom
Open
feat(table): support column projection in ReadBuilder#153QuakeWang wants to merge 1 commit intoapache:mainfrom
QuakeWang wants to merge 1 commit intoapache:mainfrom
Conversation
Contributor
Author
|
@JingsongLi hello, PTAL, and need to trigger re-run ci : ) |
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
Linked issue: close #146
Add column projection support to
ReadBuilder, allowing users to specify which columns to read from Parquet data files. This reduces unnecessary I/O for wide tables, especially on remote storage (S3/OSS), by leveraging the existingProjectionMaskin the Parquet reader layer.Brief change log
crates/paimon/src/table/read_builder.rsReadBuilder::with_projection(&[&str])— accepts column names, stores them for deferred resolution.resolve_projected_fields— resolves names toDataFields in caller-specified order; rejects unknown columns (ColumnNotExist) and duplicates (ConfigInvalid).TableRead::read_typefrom&[DataField]toVec<DataField>to support projected subsets.crates/paimon/src/arrow/reader.rsProjectionMaskto clip Parquet schema toread_typecolumns (previously only applied conditionally).RecordBatchschema matchesread_typeorder (ParquetProjectionMaskreturns columns in file-schema order, not projection order).Tests
cargo test -p paimon-integration-tests test_read_with_column_projectioncargo test -p paimon-integration-tests test_read_projection_emptycargo test -p paimon-integration-tests test_read_projection_unknown_columncargo test -p paimon-integration-tests test_read_projection_all_invalidcargo test -p paimon-integration-tests test_read_projection_duplicate_columnAPI and Format
ReadBuilder::with_projection(&[&str]) -> SelfTableRead::read_type()return type changed from&[DataField](borrowed from table schema) to&[DataField](borrowed from ownedVec<DataField>). No breaking change for callers.Documentation