Skip to content

[CALCITE-5288] '(a > 1 and a < 3) or (a > 2 and a < 4)' can't be simplified #2912

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
wants to merge 2 commits into from

Conversation

alex-plekhanov
Copy link
Contributor

No description provided.

// yelds "a >= 1 and a <= 4"
checkSimplifyFilter(
or(and(ge(aRef, literal(1)), le(aRef, literal(3))),
and(ge(aRef, literal(2)), le(aRef, literal(4)))),
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add a test like "(a >= 1 and a <= 3) or (a >= 0 and a <= 2) -> a>=0 and a<=3 "?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Member

@libenchao libenchao left a comment

Choose a reason for hiding this comment

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

+1

@libenchao
Copy link
Member

I'll merge this PR if there is no objections appear in 24 hours.

@libenchao libenchao closed this in 9e59a13 Sep 29, 2022
tanclary pushed a commit to tanclary/calcite that referenced this pull request Nov 11, 2022
…simplified to 'SEARCH(a, Sarg[(5..20)])'

This closes apache#2912
tanclary pushed a commit to tanclary/calcite that referenced this pull request Nov 28, 2022
…simplified to 'SEARCH(a, Sarg[(5..20)])'

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

Successfully merging this pull request may close these issues.

3 participants