Skip to content

[SPARK-52032][SQL] Fix orc filter pushdown with null-safe equality operator #50932

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

yuexing
Copy link

@yuexing yuexing commented May 19, 2025

What changes were proposed in this pull request?

Background:As stated in SPARK-52032: When applying a filter using eqNullSafe (<=>, null-safe equality operator) to a DataFrame created from an ORC file, rows containing null values are incorrectly excluded, even though they should be retained.

Changes:1. Added a UT in OrcFilterSuite to reproduce the issue, 2. fix the logic in OrcFilter.

Why are the changes needed?

As stated above, it's an unexpected issue

Does this PR introduce any user-facing change?

No.

How was this patch tested?

UT

Was this patch authored or co-authored using generative AI tooling?

No

@github-actions github-actions bot added the SQL label May 19, 2025
@LuciferYang LuciferYang changed the title SPARK-52032: fix orc filter pushdown with null-safe equality operator [SPARK-52032][SQL] Fix orc filter pushdown with null-safe equality operator May 19, 2025
@@ -202,6 +202,10 @@ private[sql] object OrcFilters extends OrcFiltersBase {
val rhs = buildSearchArgument(dataTypeMap, right, lhs)
rhs.end()

case Not(EqualNullSafe(name, value)) if dataTypeMap.contains(name) =>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants