Parquet: Fix notNaN for columns missing from files - #17633
Merged
RussellSpitzer merged 1 commit intoAug 13, 2026
Merged
Conversation
| int id = ref.fieldId(); | ||
|
|
||
| if (mayContainNulls.get(id)) { | ||
| if (mayContainNulls.get(id) == null || mayContainNulls.get(id)) { |
Member
There was a problem hiding this comment.
I think we should match the pattern in the other checks and just relocate if (mayContainNulls) to under the "hasNonDictPages"
The reason being the "isFallback.get(id) " would essentially be doing the "is this column there" check for us.
@Override
public <T> Boolean notNaN(BoundReference<T> ref) {
int id = ref.fieldId();
Boolean hasNonDictPage = isFallback.get(id);
if (hasNonDictPage == null || hasNonDictPage) {
return ROWS_MIGHT_MATCH;
}
if (mayContainNulls.get(id)) {
return ROWS_MIGHT_MATCH;
}
Set<T> dictionary = dict(id, comparatorForNaNPredicate(ref));
return dictionary.stream().allMatch(NaNUtil::isNaN) ? ROWS_CANNOT_MATCH : ROWS_MIGHT_MATCH;
}This is basically the same as all the others
public <T> Boolean isNaN(BoundReference<T> ref) {
int id = ref.fieldId();
Boolean hasNonDictPage = isFallback.get(id);
if (hasNonDictPage == null || hasNonDictPage) {
return ROWS_MIGHT_MATCH;
}
Set<T> dictionary = dict(id, comparatorForNaNPredicate(ref));
return dictionary.stream().anyMatch(NaNUtil::isNaN) ? ROWS_MIGHT_MATCH : ROWS_CANNOT_MATCH;
}
Contributor
Author
There was a problem hiding this comment.
good point, done.
| notNull("not_in_file"), | ||
| isNull("not_in_file"), | ||
| notEqual("not_in_file", 1.0f), | ||
| notNaN("not_in_file") |
Member
There was a problem hiding this comment.
+1 on Tests, Thanks for covering these!
yangshangqing95
force-pushed
the
fix/parquet-notnan-missing-column-npe
branch
from
August 13, 2026 19:08
b0a29c4 to
d85205e
Compare
RussellSpitzer
approved these changes
Aug 13, 2026
Member
|
Thanks @yangshangqing95 ! |
Contributor
Author
|
Thanks @RussellSpitzer for reviewing! |
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.
Fix #17632
Fix an NPE when a
notNaNpredicate references a column that has an initial default but is absent from an older Parquet file.Treat missing null metadata conservatively and add regression coverage for columns absent from Parquet files.