Skip to content

fix: support nested field paths in native index creation#3408

Merged
Xuanwo merged 2 commits into
mainfrom
xuanwo/oss-935-support-nested-field-paths-in-native-index-creation
May 20, 2026
Merged

fix: support nested field paths in native index creation#3408
Xuanwo merged 2 commits into
mainfrom
xuanwo/oss-935-support-nested-field-paths-in-native-index-creation

Conversation

@Xuanwo

@Xuanwo Xuanwo commented May 19, 2026

Copy link
Copy Markdown
Member

Native index creation was resolving requested columns through top-level Arrow schema lookup before handing the request to Lance, which rejected nested paths and could collapse a nested field to its leaf name. This PR resolves index targets with Lance field-path semantics, passes the canonical path through to Lance, and reports indexed columns from field ids as canonical full paths.

This also removes the Python native FTS guard that rejected dotted paths so scalar, vector, and FTS index creation share the same nested-field contract. Related to #3402.

@github-actions github-actions Bot added Python Python SDK Rust Rust related issues labels May 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

ACTION NEEDED

Lance follows the Conventional Commits specification for release automation.

The PR title and description are used as the merge commit message. Please update your PR title and description to match the specification.

For details on the error please inspect the "PR Title Check" action.

@Xuanwo Xuanwo changed the title Support nested field paths in native index creation fix: support nested field paths in native index creation May 19, 2026
@github-actions github-actions Bot added the bug Something isn't working label May 19, 2026
@Xuanwo
Xuanwo marked this pull request as ready for review May 19, 2026 15:53

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@mintlify

mintlify Bot commented May 19, 2026

Copy link
Copy Markdown

Docs PR opened: lancedb/docs#245

Added sections to the scalar, vector, and FTS index pages explaining how to create indexes on nested struct fields using dotted paths.

@LuQQiu

LuQQiu commented May 19, 2026

Copy link
Copy Markdown
Contributor

does it count as breaking changes?
list_indices() previous return leaf field name and now it returns full path name? and if people are doing some column name comparison in their script, it could break them

@westonpace

Copy link
Copy Markdown
Contributor

does it count as breaking changes?
list_indices() previous return leaf field name and now it returns full path name? and if people are doing some column name comparison in their script, it could break them

I think it is a grey area. If a user was only using lancedb they could not have created the index in the first place (so list_indices can't be a breaking change).

However, some users may have created the index in pylance, in which case they were getting back the old name.

Let's label it a breaking change but not worry about it (e.g. don't try and introduce some backwards compatible path).

Comment thread rust/lancedb/src/table.rs
.unwrap();
table
.create_index(
&["literal.`a.b`"],

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.

issue(non-blocking): I think this technically works, but I will note we do have some weird rules around . in column names. We don't allow them at the top-level, but do at nested levels.

https://github.com/lance-format/lance/blob/e5105f7b249e834c9a1d089416676f7f8a97e7d7/rust/lance-core/src/datatypes/schema.rs#L312-L317

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yep, this is intentional. Top-level dotted fields are rejected, but nested field names may contain ., so this case verifies that escaped nested segments round-trip as literal.a.b`` instead of being split into literal.a.b.

@Xuanwo Xuanwo added the breaking-change A breaking change in our public APIs label May 20, 2026
@Xuanwo
Xuanwo merged commit 5bfde47 into main May 20, 2026
27 of 29 checks passed
@Xuanwo
Xuanwo deleted the xuanwo/oss-935-support-nested-field-paths-in-native-index-creation branch May 20, 2026 03:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change A breaking change in our public APIs bug Something isn't working Python Python SDK Rust Rust related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants