eldenmoon commented on code in PR #32620:
URL: https://github.com/apache/doris/pull/32620#discussion_r1579240924


##########
be/src/vec/exprs/vectorized_fn_call.cpp:
##########
@@ -136,6 +136,31 @@ void VectorizedFnCall::close(VExprContext* context, 
FunctionContext::FunctionSta
     VExpr::close(context, scope);
 }
 
+Status VectorizedFnCall::eval_inverted_index(
+        VExprContext* context,
+        const std::unordered_map<ColumnId, 
std::pair<vectorized::NameAndTypePair,
+                                                     
segment_v2::InvertedIndexIterator*>>&
+                colid_to_inverted_index_iter,
+        uint32_t num_rows, roaring::Roaring* bitmap) const {
+    DCHECK_GE(get_num_children(), 1);
+    if (get_child(0)->is_slot_ref()) {
+        auto* column_slot_ref = assert_cast<VSlotRef*>(get_child(0).get());
+        if (auto iter = 
colid_to_inverted_index_iter.find(column_slot_ref->column_id());
+            iter != colid_to_inverted_index_iter.end()) {
+            const auto& pair = iter->second;
+            return 
_function->eval_inverted_index(context->fn_context(_fn_context_index),
+                                                  pair.first, pair.second, 
num_rows, bitmap);
+        } else {
+            return Status::InternalError("column id ", 
column_slot_ref->column_id(),
+                                         " not found in 
colid_to_inverted_index_iter");
+        }
+    } else {
+        return Status::InternalError("we can only eval inverted index for slot 
ref expr, but got ",

Review Comment:
   Is InernalError OK? It will print stack trace



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to