Skip to content

feat: support between sql clauses#3225

Merged
westonpace merged 4 commits intolance-format:mainfrom
connellPortrait:add-in-between
Dec 10, 2024
Merged

feat: support between sql clauses#3225
westonpace merged 4 commits intolance-format:mainfrom
connellPortrait:add-in-between

Conversation

@connellPortrait
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
Member

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
Copy Markdown
Member

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

@westonpace westonpace merged commit 7ec23f0 into lance-format:main Dec 10, 2024
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