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


##########
be/src/exec/runtime_filter/runtime_filter_mgr.cpp:
##########
@@ -91,57 +91,53 @@ Status 
RuntimeFilterMgr::register_local_merger_producer_filter(
     SCOPED_CONSUME_MEM_TRACKER(_tracker.get());
     int32_t key = desc.filter_id;
 
-    LocalMergeContext* context;
-    {
-        std::lock_guard<std::mutex> l(_lock);
-        context = &_local_merge_map[key]; // may inplace construct default 
object
+    std::lock_guard<std::mutex> l(_lock);
+    auto& context = _local_merge_map[key];
+    if (!context || producer->stage() > context->stage) {
+        auto new_context = std::make_shared<LocalMergeContext>();
+        RETURN_IF_ERROR(RuntimeFilterMerger::create(query_ctx, &desc, 
&new_context->merger));
+        new_context->stage = producer->stage();
+        context = new_context;

Review Comment:
   直接put 一次map ,语义明确一点



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