perf(scanner): renmove backtics from column names#7782
Open
yuvalif wants to merge 1 commit into
Open
Conversation
📝 WalkthroughWalkthrough
ChangesColumn expression resolution
Estimated code review effort: 1 (Trivial) | ~5 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@rust/lance-datafusion/src/planner.rs`:
- Around line 936-943: The public Planner::parse_expr API needs documentation
covering its backtick handling and expected column-resolution result. Add
rustdoc to parse_expr with links to the relevant Planner, Expr, and column types
or methods, plus a compilable example demonstrating that parsing `id` resolves
to Expr::Column; keep the implementation unchanged.
- Around line 1185-1199: The repeated identifier assertions in the planner test
should be parameterized with rstest. Update the test function containing the
parse_expr checks to use readable #[case::...] variants for each identifier
input and expected “id” column result, while keeping the separate “id + 1”
fallback assertion unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 36f3ade2-68ec-46a1-bb15-c7bf501083ae
📒 Files selected for processing (1)
rust/lance-datafusion/src/planner.rs
backtics are added around column names to support dots and other cases. however, when compare to the column names in the table schema, they never match (as the table schema columns dont have backtics). this means that we always go through the slower, sql parser code path. removing the backtics before the comparisson ensure that if the column expression matches a column name the sql path will not be needed. Fixes: lance-format#7781 Signed-off-by: Yuval Lifshitz <ylifshit@ibm.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
88f0520 to
e45f26b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
backtics are added around column names to support dots and other cases. however, when compare to the column names in the table schema, they never match (as the table schema columns dont have backtics). this means that we always go through the slower, sql parser code path. removing the backtics before the comparisson ensure that if the column expression matches a column name the sql path will not be needed.
Fixes: #7781
Summary by CodeRabbit