JingsongLi commented on code in PR #760:
URL: https://github.com/apache/paimon-rust/pull/760#discussion_r3893832093
##########
crates/paimon/src/table/vector_search_builder.rs:
##########
@@ -1221,7 +1268,12 @@ impl<'a> BatchVectorSearchBuilder<'a> {
// returns data-derived row ids/scores outside `TableScan`/`TableRead`,
// so it must refuse a `query-auth.enabled` table before any fast path
// (an empty snapshot would otherwise return empty results and bypass
it).
- let core = CoreOptions::new(self.table.schema().options());
+ let execution_table = self
+ .prepared_filter
+ .as_ref()
+ .map(PreparedVectorSearchFilter::table)
Review Comment:
[P1] Reject a prepared filter from a different table
This makes the prepared filter’s table replace the table that created the
builder, without checking that they identify the same physical table. A caller
can build on table B, pass a public `PreparedVectorSearchFilter` prepared from
table A, and—when the vector column/schema are compatible—silently search A’s
snapshot, manifest, files, and options while receiving the result through B’s
builder. The returned row IDs/scores can then be treated as belonging to the
wrong dataset. The prepared value should pin the snapshot of the builder’s
target, not retarget the builder: validate a stable table identity (at least
canonical location plus branch/reference) and fail closed on mismatch, with an
A/B regression test.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]