Skip to content

feat(file-index): support precise file index predicate evaluation - #490

Merged
lxy-9602 merged 5 commits into
apache:mainfrom
lszskye:multi_file_index_evaluate
Nov 5, 2026
Merged

lxy-9602 merged 5 commits into
apache:mainfrom
lszskye:multi_file_index_evaluate

Conversation

@lszskye

@lszskye lszskye commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Purpose

Linked issue: #452
Implement precise file-index evaluation for mixed scalar and full-text predicates, with optional vector or full-text TopK applied after filtering.

  • Add EnablePreciseFileIndexEvaluate for append-only reads and primary-key reads with deletion vectors.
  • Evaluate AND/OR predicate trees and use available selectivity estimates to order AND children.
  • Recheck scalar index candidates against the data.
  • Apply predicates, deletion vectors and row ranges before root TopK, then push the final row selection into the data reader.
  • Support multiple named score columns and keep scores aligned with selected rows.
  • Reuse the index container through an instance-based FileIndexEvaluator.

Precise evaluation requires bitmap32-compatible file row positions and rejects bitmap64 deletion vectors and merge reads. Full-text and vector searches require suitable indexes; only scalar predicates support evaluation without an index. TopK remains per file.

Tests

read_context_test.cpp
empty_file_index_reader_test.cpp
file_index_reader_test.cpp
complete_index_score_file_batch_reader_test.cpp
file_index_evaluator_test.cpp
file_index_read_executor_test.cpp
internal_read_context_test.cpp
raw_file_split_read_test.cpp
table_read_test.cpp
predicate_abi_inte_test.cpp
read_inte_with_index_test.cpp
write_and_read_inte_test.cpp

API and Format

  • Add ReadContextBuilder::EnablePreciseFileIndexEvaluate, defaulting to false, and carry the setting through ReadContext.
  • Require precise evaluation and file-index.read.enabled=true for file-level vector/full-text searches and FullTextMatch predicates.
  • Require explicit _<field>_INDEX_SCORE projections in precise mode; reject _INDEX_SCORE.
  • Extend FileIndexReader with search capability checks and selectivity estimates. Full-text TopK returns scored results, and FullTextMatch supports optional scores.
  • Add FileIndexer::CreateEmptyReader to preserve search capabilities for empty indexes.
  • Handle FullTextMatch through FileIndexReader rather than the generic scalar FunctionVisitor.

Documentation

Update the read API comments and docs/source/api/file_index.rst with the precise evaluation option, search requirements and named score projection examples.

Generative AI tooling

Generated-by: OpenAI Codex (GPT-6)

@lszskye
lszskye force-pushed the multi_file_index_evaluate branch from 337eea7 to 81177a7 Compare November 2, 2026 09:47
Comment thread docs/source/user_guide/file_index.rst Resolved
Comment thread docs/source/user_guide/file_index.rst Resolved
Comment thread include/paimon/read_context.h Resolved
@lxy-9602

lxy-9602 commented Nov 3, 2026

Copy link
Copy Markdown
Member

Please link an issue for this pr.

@SteNicholas SteNicholas left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@lszskye, I left some comments for this pull request. PTAL.

@lszskye
lszskye force-pushed the multi_file_index_evaluate branch from 81177a7 to 69ecf8e Compare November 4, 2026 12:27

@SteNicholas SteNicholas left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@lszskye, thanks for updates. I left some comments for updates: an empty IN list on a Bloom-indexed column can crash, and a sub-millisecond bound can make precise evaluation drop a matching row.

Comment thread docs/source/user_guide/file_index.rst Resolved
Comment thread docs/source/user_guide/file_index.rst Resolved
@lszskye
lszskye force-pushed the multi_file_index_evaluate branch from 4d62998 to 6713dcc Compare November 5, 2026 04:02

@SteNicholas SteNicholas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM.

@lxy-9602 lxy-9602 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1

@lxy-9602
lxy-9602 merged commit 18ea39e into apache:main Nov 5, 2026
17 checks passed
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.

3 participants