leaves12138 commented on code in PR #537:
URL: https://github.com/apache/paimon-rust/pull/537#discussion_r3612244597
##########
crates/paimon/src/table/vector_search_builder.rs:
##########
@@ -588,8 +635,9 @@ impl<'a> VectorSearchBuilder<'a> {
Some(names) => {
for name in names {
if name == PKEY_VECTOR_POSITION_COLUMN
- || name == PKEY_VECTOR_SCORE_COLUMN
+ || name == SEARCH_SCORE_COLUMN
Review Comment:
This reserved-name validation only runs for `Some(names)`. With the default
projection, a valid table column named `__paimon_search_score` is retained, and
`attach_scores_by_row_id` then appends another field with the same name. I
reproduced an output schema containing two `__paimon_search_score` columns. The
legacy `_PKEY_VECTOR_SCORE` alias is likewise rejected only for explicit
projections. Please validate the resolved/default field list as well, and add
default-projection collision coverage for both PK and DE materialization.
##########
crates/paimon/src/table/vector_search_builder.rs:
##########
@@ -283,10 +282,58 @@ impl<'a> VectorSearchBuilder<'a> {
}
}
- Err(crate::Error::DataInvalid {
- message: "vector search read is only supported for primary-key
vector indexes".into(),
- source: None,
- })
+ // Data-evolution (global-index) vector search: materialize rows from
the
+ // scored global row-ids and attach the unified score column. A
non-vector
+ // column or a set filter fails loud inside execute_scored below.
+ self.execute_de_vector_read().await
Review Comment:
This fallback can turn an invalid vector-column name into a successful empty
reader. `evaluate_batch_vector_search` returns an empty result when field
lookup fails, and the new test explicitly expects `with_vector_column("other")`
on the empty table to succeed. Through the C API, a typo therefore looks like
normal EOF instead of an input error, contrary to the `execute_read` fail-loud
contract. Please validate that the DE target field exists and has a supported
vector type before returning an empty result, with core/C coverage for unknown
and scalar columns.
--
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]