JunRuiLee commented on code in PR #550:
URL: https://github.com/apache/paimon-rust/pull/550#discussion_r3612957999


##########
crates/paimon/src/table/vector_search_builder.rs:
##########
@@ -557,12 +566,29 @@ impl<'a> VectorSearchBuilder<'a> {
             },
         );
 
-        let candidates = PkVectorOrchestrator::new(reader)
+        // Resolve the refine factor from the query options first, then fall 
back to
+        // the table options; a positive factor over-fetches indexed 
(approximate)
+        // candidates so the exact rerank below has a wider pool to reorder. 
Factor 0
+        // (unset) leaves `indexed_limit == limit`, byte-identical to the 
no-rerank
+        // path. The two option maps are kept distinct (query options passed
+        // separately from table options) so a broad query key cannot be 
overridden
+        // by a more specific table key: query options take precedence as a 
whole.
+        // `search_options` above is the merged view used only to drive the 
ANN read.
+        let refine_factor = configured_refine_factor(

Review Comment:
   Fixed in 1ab7337. `configured_refine_factor` / `indexed_search_limit` are 
now resolved **before** `PkVectorScan::plan()` and the empty-plan early return, 
so an invalid factor fails loud regardless of whether the table currently has 
searchable data — matching Java, which resolves this in the 
`PrimaryKeyVectorRead` constructor before planning. Added an empty-table 
regression test covering both invalid forms you named (`0` → "must be 
positive", and a non-integer → "must be an integer") and both option sources 
(query and table options, since the fix moved resolution of both ahead of 
planning).



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