Skip to content

feat(scanner): ignore selected scalar indices - #9034

Draft
majin1102 wants to merge 2 commits into
lance-format:mainfrom
majin1102:codex/exclude-scalar-indices
Draft

feat(scanner): ignore selected scalar indices#9034
majin1102 wants to merge 2 commits into
lance-format:mainfrom
majin1102:codex/exclude-scalar-indices

Conversation

@majin1102

@majin1102 majin1102 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a scanner option to ignore selected scalar indices while leaving all other scalar indices eligible
  • apply the ignored set by logical index name before scalar filter parsers and index details are loaded
  • expose idiomatic APIs in Rust (with_ignored_scalar_indices), Java (ignoredScalarIndexes), and Python (ignored_scalar_indices)

Motivation

External query planners can consume a scalar index during task planning and pass the resulting row selection to Lance workers. For example, lance-spark can query a ZoneMap on the driver, produce fragment-local physical slices, and then avoid querying that same ZoneMap again on executors without disabling useful BTree or other scalar indices.

This fills the gap between the existing all-or-nothing use_scalar_index option and retaining every available scalar index.

Semantics

  • ignored indices are identified by logical scalar index name
  • the original expression filter is still evaluated, so ignoring an index only changes planning/performance
  • unknown names have no effect
  • use_scalar_index = false continues to disable all scalar-index planning
  • vector index segment selection and explicit full-text search are unaffected

Validation

  • cargo fmt --all --check
  • cargo check -p lance --tests
  • cd java && ./mvnw spotless:check
  • cd java && ./mvnw -Dtest=ScannerTest,AsyncScannerTest test (54 Java tests and 22 JNI tests)
  • cd python && cargo check --release
  • Python Ruff formatting and lint checks
  • Python runtime test (local release extension linking stalled; left for CI)

The PR is intentionally opened as a draft so the API shape and naming can be discussed before lance-spark adopts it.

@github-actions github-actions Bot added A-python Python bindings A-java Java bindings + JNI enhancement New feature or request labels Sep 7, 2026
@majin1102 majin1102 changed the title feat(scanner): exclude named scalar indices feat(scanner): ignore selected scalar indices Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-java Java bindings + JNI A-python Python bindings enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant