Skip to content

ORC: fill initial defaults for missing id-bound fields - #259

Closed
cbb330 wants to merge 3 commits into
linkedin:1.2.xfrom
cbb330:chbush/orc-initial-default-id-binding
Closed

ORC: fill initial defaults for missing id-bound fields#259
cbb330 wants to merge 3 commits into
linkedin:1.2.xfrom
cbb330:chbush/orc-initial-default-id-binding

Conversation

@cbb330

@cbb330 cbb330 commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

Dependencies

Reviewer orientation

Supported scope

  • Generic ORC row reader
  • Spark 3.1 ORC row reader
  • Scalar defaults at any struct nesting level, including structs within list elements and map values

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

  • Added projection tests for trusted-id omission, id-less null synthesis, required defaults, and nested defaults
  • Added Generic ORC end-to-end tests for scalar types, required/nested/list/map defaults, present values/nulls, empty/null parent structs, and id-less files
  • Added Spark 3.1 row tests for declared, undeclared, and nested defaults
  • Full iceberg-api, iceberg-core, iceberg-orc, and iceberg-data test suites passed
  • Full Spark 3.1 test suite passed
  • API/Core/ORC RevAPI passed
  • API/Core/ORC/Spark 3.1 checkstyle and formatting passed

Tests generated with unit-tests plugin

Made with Cursor

cbb330 and others added 3 commits July 22, 2026 23:13
…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
cbb330 force-pushed the chbush/orc-initial-default-id-binding branch from ac89878 to a54931a Compare July 23, 2026 06:49
@cbb330

cbb330 commented Jul 23, 2026

Copy link
Copy Markdown
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:

  1. ORC: bind struct fields by Iceberg field id in generic and Spark 3.1 readers #256 - ORC id-binding backport (base 1.2.x)
  2. API: add column-default model support #260 - API column-default model (base chbush/orc-id-binding-backport)
  3. ORC: fill initial defaults for missing id-bound fields #261 - ORC initial-default fill (base chbush/orc-column-default-api)
  4. Spark 3.1: fill ORC initial defaults on the row reader #262 - Spark 3.1 wiring (base chbush/orc-initial-default-orc-fill)

Same net content as this PR; each layer is independently reviewable against its base branch.

@cbb330 cbb330 closed this Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant