miomiocat commented on code in PR #1522:
URL: https://github.com/apache/paimon-rust/pull/1522#discussion_r4674976595


##########
docs/src/c-binding.md:
##########
@@ -520,6 +520,13 @@ and ranges. Combine predicates with `paimon_predicate_and`,
 
 ## Vector Scan, Plan, and Read
 
+`paimon_vector_search_builder_execute_scored` returns global row IDs and scores
+as Arrow Int64 and Float32 columns named `row_id` and `score`. An inclusive
+interval supplied to `paimon_vector_search_builder_with_row_range` intersects

Review Comment:
   Updated the C guide in 0b1f75b8. It now describes the scalar-index and 
shortlist post-filter cases, the possible short result, and the global-row-ID 
requirement for `execute_scored`.



##########
crates/paimon/src/table/de_vector_read.rs:
##########
@@ -3646,6 +3704,8 @@ struct TaskVectorSearch {
     limit: usize,
     field: String,
     options: HashMap<String, String>,
+    #[serde(default)]
+    expected_distance_metric: Option<String>,

Review Comment:
   Fixed in 0b1f75b8. The coordinator validates each query's expected metric 
against the persisted metric before restoring indexed worker scores. It also 
rejects nonempty results without a metric when the caller required one. The 
regression feeds worker replies directly to this boundary, including an L2 
reply to an inner-product request.



##########
crates/paimon/src/vector_search.rs:
##########
@@ -72,6 +74,25 @@ impl VectorSearch {
         self
     }
 
+    pub fn with_expected_distance_metric(mut self, metric: String) -> Self {
+        self.expected_distance_metric = Some(metric);
+        self
+    }
+
+    pub(crate) fn ensure_distance_metric(&self, actual: &str) -> 
crate::Result<()> {
+        if let Some(expected) = &self.expected_distance_metric {
+            if expected != actual {

Review Comment:
   Fixed in 0b1f75b8. The DE route now uses the same 
`VectorSearchMetric::parse` as PK for both names. The regression accepts 
`Inner-Product` against the persisted `inner_product` metric.



-- 
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]

Reply via email to