Skip to content

[python] Reject vector and full-text search on a query-auth table - #10027

Merged
JingsongLi merged 1 commit into
apache:masterfrom
plusplusjiajia:fix/pypaimon-reject-search-under-auth
Sep 21, 2026
Merged

JingsongLi merged 1 commit into
apache:masterfrom
plusplusjiajia:fix/pypaimon-reject-search-under-auth

Conversation

@plusplusjiajia

Copy link
Copy Markdown
Member

Problem

Java refuses vector and full-text search whenever the table carries query authorization (TableQueryAuthResult.rejectSearchUnderQueryAuth): the index ranks raw values, which a column mask invalidates.

Python planned the search instead. PrimaryKeyVectorScan and PrimaryKeyFullTextScan then unwrapped the QueryAuthSplit the scan had produced and kept the bare data split, so neither the mask nor the row filter reached the result.

Change

Port the refusal to the vector, batch-vector, full-text and hybrid builders. It sits in the methods that build a scan or a read rather than in the builder constructors, matching Java: a deserialized builder skips a constructor check.

The guard is gated on isinstance(table, FileStoreTable) like Java's instanceof check, so tables that cannot carry authorization are unaffected.

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

Requirement fit: SUPPORTED (triage: GO)\nImplementation: CLEAN\n\nThis closes a concrete authorization bypass by refusing raw-value index searches on query-authorized tables, matching the Java behavior. I checked vector, batch-vector, full-text, and hybrid construction and deserialized-builder paths; the guard is applied before a search plan or read can unwrap authorization. No actionable P0/P1/P2 issue found.

@JingsongLi
JingsongLi merged commit ac77029 into apache:master Sep 21, 2026
19 of 28 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