Skip to content

Conversation

@timsaucer
Copy link
Contributor

This PR avoids a problem encountered when creating a scalar index on a column that had a name that was not easily parseable by the SQL parser. If we are getting a raw expression that matches a column name in the schema, then return it directly.

More generally I wonder if we should be doing this sql parsing at all when we know we have columns. Should ProjectionPlan::from_expressions actually take in instead columns: &[(impl AsRef<str>, &Expr)] ?

@timsaucer timsaucer changed the title feat: short circuit SQL parsing bugfix: short circuit SQL parsing Sep 26, 2025
@github-actions
Copy link
Contributor

ACTION NEEDED
Lance follows the Conventional Commits specification for release automation.

The PR title and description are used as the merge commit message. Please update your PR title and description to match the specification.

For details on the error please inspect the "PR Title Check" action.

@codecov-commenter
Copy link

codecov-commenter commented Sep 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.83%. Comparing base (4780af9) to head (4c4a613).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4825      +/-   ##
==========================================
- Coverage   80.83%   80.83%   -0.01%     
==========================================
  Files         329      329              
  Lines      129559   129562       +3     
  Branches   129559   129562       +3     
==========================================
- Hits       104730   104728       -2     
- Misses      21148    21150       +2     
- Partials     3681     3684       +3     
Flag Coverage Δ
unittests 80.83% <100.00%> (-0.01%) ⬇️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@timsaucer timsaucer changed the title bugfix: short circuit SQL parsing fix: short circuit SQL parsing Sep 26, 2025
@github-actions github-actions bot added the bug Something isn't working label Sep 26, 2025
Copy link
Contributor

@wjones127 wjones127 left a comment

Choose a reason for hiding this comment

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

Seems reasonable. Thanks!

@wjones127
Copy link
Contributor

More generally I wonder if we should be doing this sql parsing at all when we know we have columns. Should ProjectionPlan::from_expressions actually take in instead columns: &[(impl AsRef<str>, &Expr)] ?

Could you expand more on what you mean by that?

I think the intention of the expression was to allow indexing nested fields or fields within JSON blobs.

@wjones127
Copy link
Contributor

This PR avoids a problem encountered when creating a scalar index on a column that had a name that was not easily parseable by the SQL parser.

Actually, before I merge, do you think this is worth a unit test?

@wjones127 wjones127 self-assigned this Oct 2, 2025
@wjones127 wjones127 merged commit 3211f07 into lance-format:main Oct 7, 2025
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants