You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/12/07 11:03:13 UTC

[GitHub] [doris] github-actions[bot] commented on a diff in pull request #14898: [Pipeline](hashjoin) Support hash join on pipeline engine

github-actions[bot] commented on code in PR #14898:
URL: https://github.com/apache/doris/pull/14898#discussion_r1042067867


##########
be/src/vec/exec/join/vhash_join_node.cpp:
##########
@@ -586,8 +547,67 @@
     RETURN_IF_ERROR(_build_output_block(&temp_block, output_block));
     _reset_tuple_is_null_column();
     reached_limit(output_block, eos);
+    return Status::OK();
+}
 
-    return st;
+Status HashJoinNode::push(RuntimeState* state, vectorized::Block* input_block, bool eos) {

Review Comment:
   warning: parameter 'state' is unused [misc-unused-parameters]
   
   ```suggestion
   Status HashJoinNode::push(RuntimeState*  /*state*/, vectorized::Block* input_block, bool eos) {
   ```
   



##########
be/src/vec/exec/join/vhash_join_node.cpp:
##########
@@ -649,26 +677,23 @@
     if (_vother_join_conjunct_ptr) {
         RETURN_IF_ERROR((*_vother_join_conjunct_ptr)->open(state));
     }
-    RETURN_IF_ERROR(VJoinNodeBase::open(state));
-    SCOPED_CONSUME_MEM_TRACKER(mem_tracker_growh());
-    RETURN_IF_CANCELLED(state);
     return Status::OK();
 }
 
-Status HashJoinNode::_materialize_build_side(RuntimeState* state) {
-    RETURN_IF_ERROR(child(1)->open(state));
+void HashJoinNode::release_resource(RuntimeState* state) {
+    START_AND_SCOPE_SPAN(state->get_tracer(), span, "HashJoinNode::release_resources");
+    VExpr::close(_build_expr_ctxs, state);
+    VExpr::close(_probe_expr_ctxs, state);
 
-    SCOPED_TIMER(_build_timer);
-    MutableBlock mutable_block(child(1)->row_desc().tuple_descriptors());
+    if (_vother_join_conjunct_ptr) (*_vother_join_conjunct_ptr)->close(state);

Review Comment:
   warning: statement should be inside braces [readability-braces-around-statements]
   
   ```suggestion
       if (_vother_join_conjunct_ptr) { (*_vother_join_conjunct_ptr)->close(state);
   }
   ```
   



##########
be/src/vec/exec/join/vhash_join_node.cpp:
##########
@@ -586,8 +547,67 @@
     RETURN_IF_ERROR(_build_output_block(&temp_block, output_block));
     _reset_tuple_is_null_column();
     reached_limit(output_block, eos);
+    return Status::OK();
+}
 
-    return st;
+Status HashJoinNode::push(RuntimeState* state, vectorized::Block* input_block, bool eos) {

Review Comment:
   warning: parameter 'eos' is unused [misc-unused-parameters]
   
   ```suggestion
   Status HashJoinNode::push(RuntimeState* state, vectorized::Block* input_block, bool  /*eos*/) {
   ```
   



##########
be/src/vec/exec/join/vhash_join_node.cpp:
##########
@@ -442,78 +445,36 @@ Status HashJoinNode::close(RuntimeState* state) {
     if (is_closed()) {
         return Status::OK();
     }
-
-    START_AND_SCOPE_SPAN(state->get_tracer(), span, "HashJoinNode::close");
-    VExpr::close(_build_expr_ctxs, state);
-    VExpr::close(_probe_expr_ctxs, state);
-
-    if (_vother_join_conjunct_ptr) (*_vother_join_conjunct_ptr)->close(state);
-    _release_mem();
     return VJoinNodeBase::close(state);
 }
 
 Status HashJoinNode::get_next(RuntimeState* state, RowBatch* row_batch, bool* eos) {
     return Status::NotSupported("Not Implemented HashJoin Node::get_next scalar");
 }
 
-Status HashJoinNode::get_next(RuntimeState* state, Block* output_block, bool* eos) {
-    INIT_AND_SCOPE_GET_NEXT_SPAN(state->get_tracer(), _get_next_span, "HashJoinNode::get_next");
-    SCOPED_TIMER(_runtime_profile->total_time_counter());
-    SCOPED_TIMER(_probe_timer);
+bool HashJoinNode::need_more_input_data() {
+    return (_probe_block.rows() == 0 || _probe_index == _probe_block.rows()) && !_probe_eos &&
+           !_short_circuit_for_null_in_probe_side;
+}
 
+void HashJoinNode::prepare_for_next() {
+    _probe_index = 0;
+    _prepare_probe_block();
+}
+
+Status HashJoinNode::pull(doris::RuntimeState* state, vectorized::Block* output_block, bool* eos) {

Review Comment:
   warning: parameter 'state' is unused [misc-unused-parameters]
   
   ```suggestion
   Status HashJoinNode::pull(doris::RuntimeState*  /*state*/, vectorized::Block* output_block, bool* eos) {
   ```
   



##########
be/src/vec/exec/join/vhash_join_node.h:
##########
@@ -205,6 +205,14 @@ class HashJoinNode final : public VJoinNodeBase {
     void add_hash_buckets_info(const std::string& info);
     void add_hash_buckets_filled_info(const std::string& info);
 
+    virtual Status alloc_resource(RuntimeState* state) override;

Review Comment:
   warning: 'virtual' is redundant since the function is already declared 'override' [modernize-use-override]
   
   ```suggestion
       Status alloc_resource(RuntimeState* state) override;
   ```
   



##########
be/src/vec/exec/join/vjoin_node_base.h:
##########
@@ -53,6 +53,9 @@
         return *_intermediate_row_desc;
     }
 
+    virtual Status alloc_resource(RuntimeState* state) override;
+    virtual void release_resource(RuntimeState* state) override;

Review Comment:
   warning: 'virtual' is redundant since the function is already declared 'override' [modernize-use-override]
   
   ```suggestion
       void release_resource(RuntimeState* state) override;
   ```
   



##########
be/src/vec/exec/join/vhash_join_node.h:
##########
@@ -205,6 +205,14 @@
     void add_hash_buckets_info(const std::string& info);
     void add_hash_buckets_filled_info(const std::string& info);
 
+    virtual Status alloc_resource(RuntimeState* state) override;
+    virtual void release_resource(RuntimeState* state) override;

Review Comment:
   warning: 'virtual' is redundant since the function is already declared 'override' [modernize-use-override]
   
   ```suggestion
       void release_resource(RuntimeState* state) override;
   ```
   



##########
be/src/vec/exec/join/vjoin_node_base.h:
##########
@@ -53,6 +53,9 @@ class VJoinNodeBase : public ExecNode {
         return *_intermediate_row_desc;
     }
 
+    virtual Status alloc_resource(RuntimeState* state) override;

Review Comment:
   warning: 'virtual' is redundant since the function is already declared 'override' [modernize-use-override]
   
   ```suggestion
       Status alloc_resource(RuntimeState* state) override;
   ```
   



-- 
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-unsubscribe@doris.apache.org

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


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