ORC: fill initial defaults for missing id-bound fields - #259
Closed
cbb330 wants to merge 3 commits into
Closed
Conversation
…readers Backport the upstream id-based StructReader binding (apache/iceberg 77e7dbb, PR #15776) to the li-1.2.x ORC reader, adapted for the 1.2.x type system. The ORC StructReader previously bound struct fields positionally, consuming column vectors in projection order. This replaces that with id-based binding: each expected field is matched to its ORC column by Iceberg field id, which is resilient to field reordering and schema evolution. Scope: only GenericOrcReaders and Spark 3.1 SparkOrcValueReaders are converted. The positional constructor/overloads are retained and marked @deprecated because the other engine readers (Spark 2.4/3.2/3.3, Flink) still use them. Row-lineage, UNKNOWN, and VARIANT constructs from the upstream commit are omitted as they do not exist on 1.2.x. Behavior-preserving for well-formed reads: id-based binding produces identical results to positional binding on all current inputs. Co-authored-by: Cursor <cursoragent@cursor.com>
Backport the NestedField initial/write-default APIs, literal construction, and schema JSON round-trip needed to carry declared defaults into older readers. Co-authored-by: Cursor <cursoragent@cursor.com>
Use the id-binding reader to materialize declared defaults only when a field is absent from an id-bearing file. Preserve stored values and nulls, and keep name-mapped files on legacy null synthesis. Co-authored-by: Cursor <cursoragent@cursor.com>
cbb330
force-pushed
the
chbush/orc-initial-default-id-binding
branch
from
July 23, 2026 06:49
ac89878 to
a54931a
Compare
Collaborator
Author
|
Superseded by a linear 4-PR stack for reviewability (Option L), splitting this PR's two commits into isolated API and per-engine changes:
Same net content as this PR; each layer is independently reviewable against its base branch. |
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.
Summary
initial-defaultonly when the field is absent from an id-bearing ORC file.NestedFieldcolumn-default model API and schema JSON round-trip from [default values] Add NestedField column-default APIs and Expressions.lit() (~upstream #9502) #250 / Apache Iceberg #9502.idToConstant.Dependencies
1.2.x, this PR auto-reduces to the two step-2 commits below.Reviewer orientation
API: add column-default model support+ORC: fill initial defaults for missing id-bound fields.Supported scope
Vectorized ORC, other Spark/Flink readers, and predicate pushdown on omitted default columns remain deferred; opted-in tables must stay on the supported row paths.
Testing Done
iceberg-api,iceberg-core,iceberg-orc, andiceberg-datatest suites passedTests generated with unit-tests plugin
Made with Cursor