Repository navigation
feat(read): read identity partition columns from file scan tasks - #1068
Open
YinZheng-Sun wants to merge 12 commits into
Open
YinZheng-Sun wants to merge 12 commits into
YinZheng-Sun wants to merge 12 commits into
Conversation
added 4 commits
October 28, 2026 19:07
added 6 commits
October 29, 2026 12:00
Contributor
for the record: apache/iceberg#10835 this might be the most relevant discussion and per iceberg spec: partition source data columns might be always produced unless the data files are migrated from hive tables. However java's reference implementation prefers id constant from partition data. |
This branch has not been deployed
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.
Identity-partitioned source columns may be omitted from data files because their values are stored in the partition tuple. This PR carries each file’s writing spec through scan planning, JSON/REST tasks and splits, and supplies identity source constants to Parquet and Avro readers.
Reading behavior
id_to_constantmap keyed by source field ID, using the task’s own historicalPartitionSpec. Keep the spec pointer consistent with the other task fields.Projectentry points and select them during recursive field projection, including primitive leaves of existing structs. There is no separateProjectConstantorValidateConstantmethod. Like the Java reader path, projection trusts the supplied constants.Scope
Identity source columns only: bucket and other transforms do not reconstruct source values.
_partition,_spec_idand_fileare not added to this constant map. Nested/struct constant values and reconstruction of an entirely absent parent struct are outside this change. JSON tasks must retain the historical source-type information needed to decode partition values.The reader flow follows Java’s
PartitionUtil.constantsMap,GenericReaderand recursive Parquet reader construction. Feedback on spec ownership and the constant-map interface is welcome.Validation
Merged upstream
mainat748162b3and resolved the task-reader and Parquet-reader conflicts. After restoring the original metrics filter interface, rebuilt and passeddata_test(200) andparquet_test(193), plus pre-commit and clang-tidy 22.1.8 on the changed reader and metrics filter. Earlier validation also passedschema_test(566) andavro_test(255).For local Apple-toolchain testing only, an existing upstream
std::ranges::iotacall was temporarily replaced with equivalentstd::iota; the source was restored and that workaround is not committed. Clang-tidy 22.1.8 found two diagnostics in the external AvroGenericDatum.hh; both were reproduced against unmodified upstreamavro_data_util.cc.