Skip to content

Conversation

@chenkovsky
Copy link
Contributor

Which issue does this PR close?

Rationale for this change

In find_most_restrictive_predicate, operation is ignored, but it should be considered when boundaries are equal.

What changes are included in this PR?

check the operator, when boundaries are equal.

Are these changes tested?

UT

Are there any user-facing changes?

No

@github-actions github-actions bot added optimizer Optimizer rules sqllogictest SQL Logic Tests (.slt) labels Oct 22, 2025
) WHERE int_col >= 1 AND int_col <= 10;
----
logical_plan
01)Filter: test_data.int_col > Int32(1) AND test_data.int_col < Int32(10)
Copy link
Contributor

Choose a reason for hiding this comment

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

Currently this produces FilterExec: int_col@0 >= 1 AND int_col@0 <= 10

@adriangb
Copy link
Contributor

Thanks @chenkovsky

@adriangb adriangb added this pull request to the merge queue Oct 23, 2025
Merged via the queue into apache:main with commit 144f155 Oct 23, 2025
32 checks passed
tobixdev pushed a commit to tobixdev/datafusion that referenced this pull request Nov 2, 2025
## Which issue does this PR close?


- Closes apache#18214.

## Rationale for this change

In find_most_restrictive_predicate, operation is ignored, but it should
be considered when boundaries are equal.

## What changes are included in this PR?

check the operator, when boundaries are equal.

## Are these changes tested?

UT

## Are there any user-facing changes?

No
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

optimizer Optimizer rules sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PushDownFilter incorrectly optimises filter criteria with <=, >=

2 participants