Repository navigation
fix(cypher): lower list comprehensions in unwind - #209
Merged
Merged
Conversation
UNWIND passed its list expression to the physical planner unlowered, so a list comprehension reached the unreachable branch in expression.rs. Run it through rewrite_exists_in_value, as WITH and RETURN do. Closes #206
Deploying lance-csr with
|
| Latest commit: |
1705263
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://99ad7b90.lance-csr.pages.dev |
| Branch Preview URL: | https://fix-unwind-list-comprehensio.lance-csr.pages.dev |
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.
Why
UNWINDover a list comprehension panicked withentered unreachable code: the logical planner turns comprehensions into operators.WITHandRETURNturn comprehensions into plan operators before planning their expressions, butUNWINDskipped that step, so the comprehension reached an expression planner that assumes it never sees one. Both forms failed, with a filter or a map, over a literal list or a collected one.Closes #206.
What changed
UNWINDlist contains a comprehension, the planner now applies the same rewriteWITHuses: the comprehension becomes an operator on the input rows (or on a single empty row whenUNWINDstarts the query), andUNWINDthen unwinds the resulting column.UNWINDlists without a comprehension are planned exactly as before, so other queries see no plan change. This PR makes no performance claim, and the benchmark suites were not run.UNWINDalias is bound, so the alias isn't visible inside its own list expression.Validation
ProjectoverUnwindon the comprehension's column overListComprehension.cargo fmt --all,cargo clippy --workspace --all-targets -- -D warningsandcargo test --workspacepass locally.python/:make test(1803 passed, 2 skipped) andmake lintpass locally.UNWINDtake the same path but have no dedicated test. Node.js tests and the docs build weren't run, since neither bindings nor docs changed. CI pending.🤖 Generated with Claude Code