feat(index): support array object paths in JSON FTS#7377
Draft
wirybeaver wants to merge 1 commit into
Draft
Conversation
Summary: - Emit legacy, wildcard, and exact indexed path tokens for JSON arrays. - Normalize JSON query triplets with JSONPath-style $ roots, wildcards, and indexes. - Add tokenizer and dataset regressions for array-of-object JSON FTS. Test Plan: - cargo fmt --all --check - cargo test -p lance-index --features "protoc lance-encoding/protoc lance-file/protoc lance-table/protoc lance-datafusion/protoc" scalar::inverted::tokenizer::document_tokenizer::tests -- --nocapture - PROTOC=/home/user/lance-json/target/debug/build/protobuf-src-0bbb645409253599/out/bin/protoc-27.2.0 cargo test -p lance --features "protoc lance-encoding/protoc lance-file/protoc lance-index/protoc lance-table/protoc lance-datafusion/protoc" test_json_inverted_ -- --nocapture - PROTOC=/home/user/lance-json/target/debug/build/protobuf-src-0bbb645409253599/out/bin/protoc-27.2.0 cargo clippy --all --tests --benches -- -D warnings
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.
Summary:
Example:
Given this JSON document:
{ "addresses": [ {"country": "us", "street": "main"}, {"country": "ca", "street": "second"} ] }The JSON FTS tokenizer now emits path variants that let callers search both array values and exact array positions:
This means:
addresses[*].country,str,usmatches rows with any address whose country isus.addresses[0].country,str,usmatches only rows whose first address has countryus.addresses[*].types[1]becomesaddresses..types[1].Pinot references:
Test Plan: