Skip to content
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

feat: support between sql clauses #3225

Merged
merged 4 commits into from
Dec 10, 2024

Conversation

connellPortrait
Copy link
Contributor

This adds support for the sql col BETWEEN x AND y clause

@github-actions github-actions bot added the enhancement New feature or request label Dec 10, 2024
@codecov-commenter
Copy link

codecov-commenter commented Dec 10, 2024

Codecov Report

Attention: Patch coverage is 94.62366% with 10 lines in your changes missing coverage. Please review.

Project coverage is 78.53%. Comparing base (ef9d0c2) to head (725f9fa).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
rust/lance-index/src/scalar/expression.rs 92.39% 6 Missing and 1 partial ⚠️
rust/lance-datafusion/src/planner.rs 96.80% 0 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3225      +/-   ##
==========================================
+ Coverage   78.45%   78.53%   +0.07%     
==========================================
  Files         244      245       +1     
  Lines       84554    84998     +444     
  Branches    84554    84998     +444     
==========================================
+ Hits        66333    66749     +416     
- Misses      15418    15431      +13     
- Partials     2803     2818      +15     
Flag Coverage Δ
unittests 78.53% <94.62%> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@westonpace
Copy link
Contributor

I took a look and the good news is that your code all seems right.

The bad news was that Datafusion was rewriting the BETWEEN into a pair of <= and >= operators anyways 😆

So I went ahead and added the optimization in the scalar index parsing to detect anything that looks like a between and make sure we are collapsing into a single query.

@westonpace
Copy link
Contributor

Feel free to test this out and let me know if it helps your original issue.

@westonpace westonpace merged commit 7ec23f0 into lancedb:main Dec 10, 2024
25 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants