-
Notifications
You must be signed in to change notification settings - Fork 506
ORC-1898: When column is all null, NULL_SAFE_EQUALS pushdown doesn't get evaluated correctly #2223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Conversation
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
Member
|
Thank you for making a PR, @jayhan94 . |
wgtmac
approved these changes
May 12, 2025
Member
wgtmac
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable to me. Thanks!
dongjoon-hyun
approved these changes
May 21, 2025
Member
dongjoon-hyun
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dongjoon-hyun
pushed a commit
that referenced
this pull request
May 21, 2025
…get evaluated correctly ### What changes were proposed in this pull request? When all values in column `col_0` are `NULL`s within a row group, and we attempt to apply the predicate pushdown `col_0 <=> 'xxx'`, the `evaluatePredicateProto` function returns `TruthValue.NULL`. In this case, we can directly determine the result based on the literal value: if the literal is `NULL`, return `TruthValue.YES`, otherwise, return `TruthValue.NO`. ### Why are the changes needed? See [SPARK-52032](https://issues.apache.org/jira/projects/SPARK/issues/SPARK-52032). When we pushdown the NULL_SAFE_EQUALS predicate, all values of the column are `NULL`. The `evaluatePredicateProto` returns `TruthValue.NULL`, whose `isNeeded` returns false so that the whole row group is skipped by `SargApplier.pickRowGroups`, which actually is incorrect. ### How was this patch tested? There already exists unit test -- `TestOrcTimezonePPD.testTimestampAllNulls` ### Was this patch authored or co-authored using generative AI tooling? Co-authored using generative AI tooling. Closes #2223 from jayhan94/fix_null_safe_equals_pred_push. Authored-by: Jay Han <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]> (cherry picked from commit 467a293) Signed-off-by: Dongjoon Hyun <[email protected]>
dongjoon-hyun
pushed a commit
that referenced
this pull request
May 21, 2025
…get evaluated correctly ### What changes were proposed in this pull request? When all values in column `col_0` are `NULL`s within a row group, and we attempt to apply the predicate pushdown `col_0 <=> 'xxx'`, the `evaluatePredicateProto` function returns `TruthValue.NULL`. In this case, we can directly determine the result based on the literal value: if the literal is `NULL`, return `TruthValue.YES`, otherwise, return `TruthValue.NO`. ### Why are the changes needed? See [SPARK-52032](https://issues.apache.org/jira/projects/SPARK/issues/SPARK-52032). When we pushdown the NULL_SAFE_EQUALS predicate, all values of the column are `NULL`. The `evaluatePredicateProto` returns `TruthValue.NULL`, whose `isNeeded` returns false so that the whole row group is skipped by `SargApplier.pickRowGroups`, which actually is incorrect. ### How was this patch tested? There already exists unit test -- `TestOrcTimezonePPD.testTimestampAllNulls` ### Was this patch authored or co-authored using generative AI tooling? Co-authored using generative AI tooling. Closes #2223 from jayhan94/fix_null_safe_equals_pred_push. Authored-by: Jay Han <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]> (cherry picked from commit 467a293) Signed-off-by: Dongjoon Hyun <[email protected]>
dongjoon-hyun
pushed a commit
that referenced
this pull request
May 21, 2025
…get evaluated correctly ### What changes were proposed in this pull request? When all values in column `col_0` are `NULL`s within a row group, and we attempt to apply the predicate pushdown `col_0 <=> 'xxx'`, the `evaluatePredicateProto` function returns `TruthValue.NULL`. In this case, we can directly determine the result based on the literal value: if the literal is `NULL`, return `TruthValue.YES`, otherwise, return `TruthValue.NO`. ### Why are the changes needed? See [SPARK-52032](https://issues.apache.org/jira/projects/SPARK/issues/SPARK-52032). When we pushdown the NULL_SAFE_EQUALS predicate, all values of the column are `NULL`. The `evaluatePredicateProto` returns `TruthValue.NULL`, whose `isNeeded` returns false so that the whole row group is skipped by `SargApplier.pickRowGroups`, which actually is incorrect. ### How was this patch tested? There already exists unit test -- `TestOrcTimezonePPD.testTimestampAllNulls` ### Was this patch authored or co-authored using generative AI tooling? Co-authored using generative AI tooling. Closes #2223 from jayhan94/fix_null_safe_equals_pred_push. Authored-by: Jay Han <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]> (cherry picked from commit 467a293) Signed-off-by: Dongjoon Hyun <[email protected]>
dongjoon-hyun
pushed a commit
that referenced
this pull request
May 21, 2025
…get evaluated correctly ### What changes were proposed in this pull request? When all values in column `col_0` are `NULL`s within a row group, and we attempt to apply the predicate pushdown `col_0 <=> 'xxx'`, the `evaluatePredicateProto` function returns `TruthValue.NULL`. In this case, we can directly determine the result based on the literal value: if the literal is `NULL`, return `TruthValue.YES`, otherwise, return `TruthValue.NO`. ### Why are the changes needed? See [SPARK-52032](https://issues.apache.org/jira/projects/SPARK/issues/SPARK-52032). When we pushdown the NULL_SAFE_EQUALS predicate, all values of the column are `NULL`. The `evaluatePredicateProto` returns `TruthValue.NULL`, whose `isNeeded` returns false so that the whole row group is skipped by `SargApplier.pickRowGroups`, which actually is incorrect. ### How was this patch tested? There already exists unit test -- `TestOrcTimezonePPD.testTimestampAllNulls` ### Was this patch authored or co-authored using generative AI tooling? Co-authored using generative AI tooling. Closes #2223 from jayhan94/fix_null_safe_equals_pred_push. Authored-by: Jay Han <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]> (cherry picked from commit 467a293) Signed-off-by: Dongjoon Hyun <[email protected]>
Member
Member
|
This is merged to all live release branches for Apache ORC 2.2/2.1/2.0/1.9/1.8. |
This was referenced May 21, 2025
Closed
Closed
Closed
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?
When all values in column
col_0areNULLs within a row group, and we attempt to apply the predicate pushdowncol_0 <=> 'xxx', theevaluatePredicateProtofunction returnsTruthValue.NULL. In this case, we can directly determine the result based on the literal value: if the literal isNULL, returnTruthValue.YES, otherwise, returnTruthValue.NO.Why are the changes needed?
See SPARK-52032.
When we pushdown the NULL_SAFE_EQUALS predicate, all values of the column are
NULL. TheevaluatePredicateProtoreturnsTruthValue.NULL, whoseisNeededreturns false so that the whole row group is skipped bySargApplier.pickRowGroups, which actually is incorrect.How was this patch tested?
There already exists unit test --
TestOrcTimezonePPD.testTimestampAllNullsWas this patch authored or co-authored using generative AI tooling?
Co-authored using generative AI tooling.