Repository navigation
fix(query): stop explain() panicking on long parameter values - #147
Merged
Merged
Conversation
Rust's format width is capped at u16::MAX, so padding the explain table to a line over 65,535 characters (a list parameter of ~5,000 ints) panicked. Pad by hand, and let lines over 1,000 characters overflow the border instead of widening every row: padding to them made the output grow with lines x width (2.3 GB for 6,000 ids). Fixes #145
Deploying lance-csr with
|
| Latest commit: |
405a455
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://b481d3d0.lance-csr.pages.dev |
| Branch Preview URL: | https://fix-explain-wide-plans.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.
Fixes #145.
Problem
explain()lays the three plans out as a table and padded every line with{:<width$}to the widest line. Rust caps format widths atu16::MAX, so a plan line over 65,535 characters (a list parameter of about 5,000 ints, or a long query vector) panicked.execute()was unaffected.Removing the panic alone wasn't enough: padding every line to the widest one makes the output grow with lines × width. The graph logical plan prints each list element over several lines, so 6,000 ids produced a 2.3 GB string, and 20,000 ids took 44 s in a debug build.
Change
docs/cypher.mdon the overflow.(Debug build,
CypherQuery.explain.)Tests
test_explain_with_large_list_parameter(6,000 ids, line width 77k).make install && uv run --no-sync pytest python/tests/test_explain.pycargo test -p lance-csr --lib,cargo clippy -p lance-csr --all-targets -- -D warningsuv run --project docs --locked zensical build --strict,uvx typos@1.51.1 .🤖 Generated with Claude Code