ORC: don't push file filters for omitted initial-default fields - #269
Open
cbb330 wants to merge 5 commits into
Open
ORC: don't push file filters for omitted initial-default fields#269cbb330 wants to merge 5 commits into
cbb330 wants to merge 5 commits into
Conversation
cbb330
force-pushed
the
chbush/oh120-orc-defaults-raymond-pr3
branch
from
August 12, 2026 19:20
3fff6c3 to
aec1304
Compare
cbb330
force-pushed
the
chbush/oh120-orc-defaults-raymond-pr3
branch
from
August 12, 2026 20:31
aec1304 to
dc60d6a
Compare
This was referenced Aug 12, 2026
cbb330
force-pushed
the
chbush/oh120-orc-defaults-raymond-pr3
branch
from
August 12, 2026 23:06
dc60d6a to
0fc9d35
Compare
Empty read projections no longer crash convert (#118). Predicates on omitted fields become YES_NO_NULL so Spark can filter filled defaults. Preserve defaults across TypeUtil schema copies so table create round-trips them.
With vectorization enabled, projections that include an initial-default must not take the columnar ORC path.
Keep the why (empty projection, SARG disable) without stacking ticket numbers.
cbb330
force-pushed
the
chbush/oh120-orc-defaults-raymond-pr3
branch
from
August 13, 2026 00:36
0fc9d35 to
c4b556c
Compare
Omitting a nested initial-default can leave struct<loc:struct<>>, which fails convert() even though the root schema is non-empty. Treat that as no bindable columns. Cover mixed-file IS NOT NULL/upper/= CA filters and parent-null nested defaults in Spark SQL. Co-authored-by: Cursor <cursoragent@cursor.com>
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
When a defaulted column is omitted from the ORC file projection (#267), Spark may still filter on it (
WHERE country = 'US'). Pushing that filter into the file fails in two ways:This PR stops pushing file-level predicates for omitted defaulted fields. Spark evaluates those filters on the filled values after read. Empty projections no longer crash.
Also:
TypeUtilschema copies (AssignFreshIds/PruneColumns/ReassignIds) now keepinitialDefaultviaNestedField.from(field), so table-create andSELECTround-trips do not drop defaults.Stacked on #268 → #267.
Testing Done
initialDefaultsurvives TypeUtil copies