Skip to content

feat(datafusion): expose hybrid search scores#519

Merged
JingsongLi merged 1 commit into
apache:mainfrom
QuakeWang:hybrid-score
Jul 14, 2026
Merged

feat(datafusion): expose hybrid search scores#519
JingsongLi merged 1 commit into
apache:mainfrom
QuakeWang:hybrid-score

Conversation

@QuakeWang

Copy link
Copy Markdown
Member

Purpose

DataFusion hybrid search currently discards the fused scores returned by execute_scored, so queries cannot access the Spark-compatible __paimon_search_score metadata column.

Brief change log

  • Expose __paimon_search_score from hybrid-search table functions.
  • Match scanned rows through _ROW_ID and append scores without exposing the internal row ID.
  • Preserve projection, count, limit, empty-result, and row-tracking-only behavior.

Tests

  • cargo test -p paimon-datafusion physical_plan::search_score::tests
  • cargo test -p paimon-datafusion hybrid_search_tests
  • cargo test -p paimon-datafusion --features fulltext hybrid_search_tests

API and Format

Adds the nullable Float32 metadata column __paimon_search_score to hybrid-search results. No storage-format change.

Documentation

Updated the SQL documentation.

DataFusion hybrid search discarded fused scores, preventing queries from selecting the Spark-compatible search-score metadata column.

Expose __paimon_search_score and materialize it by matching scan rows through _ROW_ID while preserving projection, empty-result, and row-tracking-only behavior.

Signed-off-by: QuakeWang <wangfuzheng0814@foxmail.com>

@JingsongLi JingsongLi left a comment

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.

+1

@JingsongLi JingsongLi merged commit 3484fb0 into apache:main Jul 14, 2026
12 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.

2 participants