fix: short circuit SQL parsing#4825
Conversation
|
ACTION NEEDED 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 Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
wjones127
left a comment
There was a problem hiding this comment.
Seems reasonable. Thanks!
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. |
Actually, before I merge, do you think this is worth a unit test? |
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)]` ?
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_expressionsactually take in insteadcolumns: &[(impl AsRef<str>, &Expr)]?