Skip to content

fix(index): Fixing name collision for label tags in tantivy index (#2219) - #2228

Open
srivik wants to merge 1 commit into
filodb:integrationfrom
srivik:integration
Open

fix(index): Fixing name collision for label tags in tantivy index (#2219)#2228
srivik wants to merge 1 commit into
filodb:integrationfrom
srivik:integration

Conversation

@srivik

@srivik srivik commented May 11, 2026

Copy link
Copy Markdown
Contributor

Description:

Summary

  • Fixes a bug where filtering by a label whose name matches the MapColumn name
    (e.g., tags="b1.metal" when the partition schema MapColumn is also named "tags")
    returns no data in the Tantivy index
  • The root cause is Tantivy's find_field_with_default resolving the field name to
    the JSON field itself with an empty prefix, producing an incorrect query term
  • Group-by (by (tags)) was unaffected because it reads from partition key binary data
    directly, bypassing the index

Changes

  • Added resolve_field_with_default() in query_parser.rs that detects when a field
    name collides with the JSON column name and treats it as a subfield path
  • Applied the fix to equals, regex, prefix, and term-in query paths
  • Applied equivalent fix in reader.rs for label value lookups

Test plan

  • Rust unit tests: equals, regex, term-in, prefix with map column name collision
  • Scala integration test: end-to-end indexing + querying with tags:map schema
  • Verify on deployment with part-key-index-type = tantivy that tags="value"
    filters now return correct results

* Fix for name collision for label tags in tantivy index

* Review comments

* Fix review comments

---------

Co-authored-by: Srividhya Anantharamakrishnan <srividhyaka@apple.com>
@srivik
srivik marked this pull request as ready for review May 11, 2026 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants