yiguolei commented on code in PR #66472:
URL: https://github.com/apache/doris/pull/66472#discussion_r3747762951


##########
be/src/exec/scan/olap_scanner.cpp:
##########
@@ -191,11 +189,16 @@ Status OlapScanner::_prepare_impl() {
         context->prepare_ann_range_search(_vector_search_params);
     }
 
-    for (auto pair : local_state->_slot_id_to_virtual_column_expr) {
-        // Scanner will be executed in a different thread, so we need to clone 
the context.
-        VExprContextSPtr context;
-        RETURN_IF_ERROR(pair.second->clone(_state, context));
-        _slot_id_to_virtual_column_expr[pair.first] = context;
+    for (uint32_t ordinal = 0; auto* slot : _output_tuple_desc->slots()) {
+        if (slot->get_virtual_column_expr()) {
+            auto expr_it = 
local_state->_slot_id_to_virtual_column_expr.find(slot->id());
+            DORIS_CHECK(expr_it != 
local_state->_slot_id_to_virtual_column_expr.end());
+            // Scanner will be executed in a different thread, so we need to 
clone the context.
+            VExprContextSPtr context;
+            RETURN_IF_ERROR(expr_it->second->clone(_state, context));
+            _virtual_column_exprs[ordinal] = std::move(context);

Review Comment:
   如果这个_virtual_column_exprs 的key 是columnid,这里直接从0 开始,感觉跟之前的tablet column的id 重合了



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