Skip to content

[core] Support NOT EQUAL and NOT IN filters on centroid shard bitmaps - #11352

Open
QuakeWang wants to merge 1 commit into
apache:masterfrom
QuakeWang:centroid-not
Open

QuakeWang wants to merge 1 commit into
apache:masterfrom
QuakeWang:centroid-not

Conversation

@QuakeWang

Copy link
Copy Markdown
Member

Purpose

Centroid shard bitmaps could not evaluate <> or NOT IN. Without an applicable standalone scalar index, these filters run after ANN ranking over a bounded candidate set and can miss qualifying rows.

Evaluate both predicates with the shard bitmaps before ranking. Preserve SQL NULL semantics and the existing fallback, and apply Spark signed-zero semantics consistently during ranking and row reads.

Tests

58 Spark tests and 35 targeted Java tests passed. Spotless, Checkstyle, and the documentation build passed.

@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.

This fixes a real Top K correctness issue. I ran 110 targeted Java tests on this head and 20 Spark 3.5.9 centroid tests with the runtime changes applied over current master ae135d59c9. All passed, including negative predicates, NULLs and signed zeros. The PR conflicts in docs/docs/multimodal-table/global-index/vector.mdx after the centroid documentation was moved. Please rebase and apply the supported-predicate update under “Scalar Bitmap Filters in Centroid Shards” in centroid-vector.mdx. Centroid documentation move

Centroid shard bitmaps cannot apply negated predicates, so the bounded
ANN candidate window can fill with rows that the filter excludes.

Apply NOT EQUAL and NOT IN before ranking with the existing Bitmap
reader. Preserve SQL NULL semantics and use consistent Spark signed-zero
comparisons for ranking and row reads.

Signed-off-by: QuakeWang <wangfuzheng0814@foxmail.com>
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