Spark 3.1: fill ORC initial defaults on the row reader - #264
Open
cbb330 wants to merge 1 commit into
Open
Conversation
This was referenced Jul 23, 2026
cbb330
force-pushed
the
chbush/oh120-orc-default-fill
branch
from
July 25, 2026 01:04
a888bee to
4db9002
Compare
cbb330
force-pushed
the
chbush/oh120-spark31-default-fill
branch
from
July 25, 2026 01:04
93e4737 to
b22ffd9
Compare
This was referenced Jul 25, 2026
cbb330
force-pushed
the
chbush/oh120-orc-default-fill
branch
from
July 28, 2026 02:35
4db9002 to
cac8ff0
Compare
cbb330
force-pushed
the
chbush/oh120-spark31-default-fill
branch
from
July 28, 2026 02:35
b22ffd9 to
748e269
Compare
cbb330
force-pushed
the
chbush/oh120-orc-default-fill
branch
from
July 28, 2026 03:11
cac8ff0 to
1115244
Compare
cbb330
force-pushed
the
chbush/oh120-spark31-default-fill
branch
2 times, most recently
from
July 28, 2026 07:13
5de2a95 to
4f928f2
Compare
cbb330
force-pushed
the
chbush/oh120-orc-default-fill
branch
from
July 28, 2026 07:13
1115244 to
0e7b860
Compare
Opt the Spark 3.1 row ORC reader into default filling by supplying Spark's constant converter to the id-binding StructReader, so an absent field that declares an initial-default is materialized in Spark's in-memory representation. Move convertConstant out of BaseDataReader into SparkValueConverters in the data package, mirroring Flink's RowDataUtil. The converter is a value conversion utility rather than reader behavior, and the readers that need it live in the data package. This keeps BaseDataReader package-private instead of widening an internal class to public, and leaves the dependency running source -> data. Mirrors the Generic reader; the visitor call site is unchanged. Vectorized reads are not wired yet, so a table whose schema declares defaults must stay on the row reader. Co-authored-by: Cursor <cursoragent@cursor.com>
cbb330
force-pushed
the
chbush/oh120-spark31-default-fill
branch
from
July 29, 2026 06:08
4f928f2 to
5549db5
Compare
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
Opts the Spark 3.1 row ORC reader into default filling by supplying
BaseDataReader's constant converter to the id-bindingStructReader, so an absent field declaring aninitial-defaultis materialized in Spark's in-memory representation.SparkOrcReaderis unchanged and byte-identical to upstream — the converter is supplied bySparkOrcValueReaders.StructReaderin its own constructor.BaseDataReader.convertConstantis made public so the reader package can reference it.BatchDataReadercarries a follow-up note: vectorized reads are not wired, so a table whose schema declares defaults must stay on the row reader.Provenance
Net new, like #263 —
apache/mainthrowsUnsupportedOperationExceptionrather than reading ORC defaults. The design follows upstream's Parquet reader, where each engine supplies its own constant conversion.Stack
StructReaderbackport (base:openhouse-1.2.0)Depends on #263's converter-aware constructor. Review this PR's own delta against its base branch
chbush/oh120-orc-default-fill.Supported scope
Spark 3.1 ORC row reader. Vectorized ORC, other Spark/Flink readers, and predicate pushdown on omitted default columns remain deferred.
Testing Done
TestSparkOrcReaderDefaults(3),TestSparkOrcReader(13),TestSparkOrcReadMetadataColumns(6) — 22 tests, 0 failuresTests generated with unit-tests plugin
Made with Cursor