ORC: omit initial-defaults only for complete embedded field IDs - #268
ORC: omit initial-defaults only for complete embedded field IDs#268cbb330 wants to merge 1 commit into
Conversation
06ca6ab to
19dee1b
Compare
19dee1b to
671fbd8
Compare
|
@mkuchenbecker carrying over your notes from #263. they apply here more than on the closed PR (that was a discarded strategy. it was net-new code and too complex. here we are building off a previous implementation that landed in prod for hive, and forward porting the mechanism) TLDR; we do not fill defaults on name-mapped files. We do that using
When we skip name mapping entirely, those files would still read the way they do today. We just would not fill defaults. That matches the restriction you suggested: only fill when the file already has complete embedded field IDs. Reading does not require a rewrite. Filling does, the file has to have been written (or rewritten) with Iceberg ORC headers. We can call that out in the as a feature contract. btw we did not throw. Throwing on name-mapped / incomplete-ID files would break existing reads. The correctness fix is that we do not fill unless |
| * default here would fabricate values over real data, so absent fields are synthesized as null | ||
| * columns instead. | ||
| */ | ||
| NAME_MAPPED |
There was a problem hiding this comment.
@mkuchenbecker this is the site for your name-mapping / Kyoto / rewrite notes from #263.
We are not adding a mapping. NAME_MAPPED means IDs were applied at read time by the existing Iceberg name mapping, and we never omit/fill on that path (a rename the mapping misses can look absent while data is still in the file).
Fill only for EMBEDDED + complete IDs. Files without headers stay readable as today (null, not default). Full write-up: #268 (comment)
671fbd8 to
eef5beb
Compare
Name-mapped or partially annotated files cannot prove a column was never written, so they keep the null-synthesizing path instead of filling a default.
eef5beb to
96f1b47
Compare
Summary
supportsInitialDefaults), the file uses EMBEDDED Iceberg field IDs, and the file has a complete id set.Testing Done
TestBuildOrcProjection,TestORCSchemaUtil.testHasAllIds, Spark reader partial-ID cases)Dependencies