kaka11chen commented on code in PR #63666:
URL: https://github.com/apache/doris/pull/63666#discussion_r3310590911


##########
be/src/exprs/vexpr_context.cpp:
##########
@@ -440,41 +441,57 @@ Status VExprContext::evaluate_ann_range_search(
         const std::unordered_map<VExprContext*, std::unordered_map<ColumnId, 
VExpr*>>&
                 common_expr_to_slotref_map,
         roaring::Roaring& row_bitmap, segment_v2::AnnIndexStats& 
ann_index_stats,
-        bool enable_result_cache) {
+        bool enable_result_cache, bool* ann_range_search_executed) {
+    if (ann_range_search_executed != nullptr) {
+        *ann_range_search_executed = false;
+    }
     if (_root == nullptr) {
         return Status::OK();
     }
 
+    AnnRangeSearchEvaluationResult evaluation_result;
     RETURN_IF_ERROR(_root->evaluate_ann_range_search(
             _ann_range_search_runtime, cid_to_index_iterators, idx_to_cid, 
column_iterators,
-            row_bitmap, ann_index_stats, enable_result_cache));
+            row_bitmap, ann_index_stats, enable_result_cache, 
evaluation_result));
 
-    if (!_root->ann_range_search_executedd()) {
+    if (!evaluation_result.executed) {
         return Status::OK();
     }
+    if (ann_range_search_executed != nullptr) {
+        *ann_range_search_executed = true;
+    }
+
+    DCHECK(_index_context != nullptr);
+    _index_context->set_index_result_for_expr(
+            _root.get(),
+            
segment_v2::InvertedIndexResultBitmap(std::make_shared<roaring::Roaring>(row_bitmap),
+                                                  
std::make_shared<roaring::Roaring>()));
 
-    if (!_root->ann_dist_is_fulfilled()) {
+    if (!evaluation_result.dist_fulfilled) {
         // Do not perform index scan in this case.
         return Status::OK();
     }
 
-    auto src_col_idx = _ann_range_search_runtime.src_col_idx;
+    DCHECK_LT(_ann_range_search_runtime.src_col_idx, idx_to_cid.size());
+    const auto src_col_idx = 
cast_set<int>(_ann_range_search_runtime.src_col_idx);

Review Comment:
   因为有两个地方要调用,需要不同类型的参数。
   `slot_ref_map.find(src_col_key)`
   `_index_context->set_true_for_index_status(slot_ref_expr_addr, src_col_idx)`



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to