Skip to content

fix(index): decline incompatible JSON accessor paths - #9260

Open
lance-gatefixer[bot] wants to merge 1 commit into
mainfrom
gatekeeper/fix-9257-1
Open

lance-gatefixer[bot] wants to merge 1 commit into
mainfrom
gatekeeper/fix-9257-1

Conversation

@lance-gatefixer

Copy link
Copy Markdown
Contributor

Summary

  • decline JSON scalar-index routing when a typed accessor path has different semantics from JSONPath
  • keep safe bare object-key accessors indexed while rejecting nested, root-prefixed, normalized, and numeric paths
  • add parser boundary coverage and an indexed-versus-unindexed regression test

Root cause

JSON index training evaluates the configured path as full JSONPath, but typed accessors perform a single literal object-key lookup or root-array index lookup. The query router matched only the path spelling, so incompatible expressions such as $.user.age could query nested index keys even though the unindexed accessor looked for a literal top-level key.

Validation

  • cargo fmt --all
  • cargo clippy --all --tests --benches -- -D warnings
  • cargo test -p lance-index test_path_matches_typed_accessor
  • cargo test -p lance-index test_expressions -- --nocapture
  • cargo test -p lance-index test_multi_json_indices_route_by_path
  • cargo test -p lance test_nested_json_path_typed_accessor_matches_unindexed_results
  • cargo test -p lance test_json_extract_matches_unindexed_results

Fixes #9257

@github-actions github-actions Bot added A-index Vector index, linalg, tokenizer bug Something isn't working labels Sep 15, 2026

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Gate recommendation: approve.

The guard matches the actual semantic boundary: only an unchanged bare object key is shared by JSONPath training and typed-accessor lookup, while root-prefixed, nested, normalized, and numeric spellings now fall back to correct scans. This preserves safe bare-key acceleration without broadening accessor semantics, and the parser/routing plus indexed-versus-unindexed regressions cover the boundary.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-index Vector index, linalg, tokenizer bug Something isn't working K-approved Latest Gatekeeper recommendation permits acceptance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: JSON index on a nested path is matched by typed accessors that cannot evaluate it, so indexed and unindexed results disagree

0 participants