Skip to content

Conversation

sundy-li
Copy link
Member

@sundy-li sundy-li commented Oct 10, 2025

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

chore(query): constant folder support exclusive check

If expressions are exclusive bounds, constant folder should return false

    run_text(file, "a > 2 and a < 1", domains);
    run_text(file, "a = 2 and a < 1", domains);
    run_text(file, "a < 2 and a > 2", domains);

    run_text(file, "a >= 3 and a < 2", domains);
    run_text(file, "a <= 1 and a > 3", domains);
    run_text(file, "a = 5 and a = 7", domains);
    run_text(file, "a > 10 and a < 5", domains);
    run_text(file, "a >= 5 and a <= 2", domains);

sql:

query T
explain select 1 from range_t where c > 'efg' and c = 'efg'
----
EmptyResultScan

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@github-actions github-actions bot added the pr-chore this PR only has small changes that no need to record, like coding styles. label Oct 10, 2025
@sundy-li sundy-li requested a review from forsaken628 October 10, 2025 02:45
@sundy-li sundy-li merged commit 6cbbbf7 into databendlabs:main Oct 12, 2025
87 checks passed
@sundy-li sundy-li deleted the folder-exclusive branch October 12, 2025 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-chore this PR only has small changes that no need to record, like coding styles.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants