hello-stephen commented on code in PR #9290:
URL: https://github.com/apache/incubator-doris/pull/9290#discussion_r861552180


##########
be/src/vec/exec/join/vhash_join_node.cpp:
##########
@@ -956,10 +956,19 @@ Status HashJoinNode::open(RuntimeState* state) {
         RETURN_IF_ERROR((*_vother_join_conjunct_ptr)->open(state));
     }
 
-    RETURN_IF_ERROR(_hash_table_build(state));
-    RETURN_IF_ERROR(child(0)->open(state));
+    std::promise<Status> thread_status;
+    std::thread(bind(&HashJoinNode::_hash_table_build_thread, this, state, 
&thread_status))
+            .detach();
 
-    return Status::OK();
+    Status open_status = child(0)->open(state);

Review Comment:
   because I noticed this in non-vectorized hash_join_node.cpp, 
   ```
           // Open the probe-side child so that it may perform any 
initialisation in parallel.
           // Don't exit even if we see an error, we still need to wait for the 
build thread
           // to finish.
           Status open_status = child(0)->open(state);
   
           // Blocks until ConstructHashTable has returned, after which
           // the hash table is fully constructed and we can start the probe
           // phase.
           RETURN_IF_ERROR(thread_status.get_future().get());
   
           // ISSUE-1247, check open_status after buildThread execute.
           // If this return first, build thread will use 'thread_status'
           // which is already destructor and then coredump.
           RETURN_IF_ERROR(open_status);
   ```



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