Repository navigation
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the nested-struct IS_NULL row-group pruning fix.
No open issues 🎉
What changed in this PR
This PR fixes Java ORC row-group pruning for IS_NULL predicates on fields nested in structs, whose statistics omit rows with null ancestors.
Changes:
- Track struct ancestry and return
YES_NO_NULLfor affected predicates so matching row groups are not skipped. - Preserve existing behavior for other operators and top-level columns.
- Add a regression test verifying that a row group containing a null parent struct is read.
| File | Description |
|---|---|
java/core/src/test/org/apache/orc/impl/TestRecordReaderImpl.java |
Adds regression coverage for IS_NULL under a null struct. |
java/core/src/java/org/apache/orc/impl/RecordReaderImpl.java |
Prevents statistics-based pruning for nested-struct IS_NULL predicates. |
Review effort: Balanced
This branch has not been deployed
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.
What changes were proposed in this pull request?
SargApplierno longer uses row group statistics to answerIS_NULLfor a column nested in a struct. The leaf evaluates toYES_NO_NULLinstead, so those row groups are read. Other operators and top-level columns are unchanged.Why are the changes needed?
ORC writes a struct field only in rows where all of its ancestors are present, so the field's statistics do not count rows where a parent struct is null. When the field itself is never null,
hasNullis false andIS_NULLevaluates toNO, which skips row groups that contain matching rows:Reproduced on 1.9.8, 2.1.4 and 2.3.1. Spark (SPARK-60362) and Iceberg (apache/iceberg#19064) hit the same case through their ORC readers.
How was this patch tested?
Added
TestRecordReaderImpl#testIsNullOnFieldUnderNullStruct, which fails without the change (reads 0 rows instead of 2).TestRecordReaderImpl,TestVectorOrcFile,TestReaderImpl,TestFilters,TestPluginFilters,TestOrcFilterContext,TestRowFilteringIOSkip,TestStringDictionaryandTestEncryptionpass.Was this patch authored or co-authored using generative AI tooling?
Yes. Generated-by: an AI coding assistant, used to draft the change and the test; I reviewed and tested both.