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


##########
be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp:
##########
@@ -634,8 +635,8 @@
     return Status::OK();
 }
 
-Status PipelineXFragmentContext::_add_local_exchange(int idx, int node_id, 
ObjectPool* pool,
-                                                     PipelinePtr cur_pipe,
+Status PipelineXFragmentContext::_add_local_exchange(int pip_idx, int idx, int 
node_id,

Review Comment:
   warning: function '_add_local_exchange' exceeds recommended size/complexity 
thresholds [readability-function-size]
   ```cpp
   Status PipelineXFragmentContext::_add_local_exchange(int pip_idx, int idx, 
int node_id,
                                    ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp:637:** 91 lines 
including whitespace and comments (threshold 80)
   ```cpp
   Status PipelineXFragmentContext::_add_local_exchange(int pip_idx, int idx, 
int node_id,
                                    ^
   ```
   
   </details>
   



##########
be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp:
##########
@@ -251,38 +252,38 @@ Status PipelineXFragmentContext::prepare(const 
doris::TPipelineFragmentParams& r
 
 Status PipelineXFragmentContext::_plan_local_shuffle() {
     for (int pip_idx = _pipelines.size() - 1; pip_idx >= 0; pip_idx--) {
-        auto& children = _pipelines[pip_idx]->children();
-        if (children.empty()) {
-            _pipelines[pip_idx]->init_need_to_local_shuffle_by_source();
-        } else if (children.size() == 1) {
-            
_pipelines[pip_idx]->set_need_to_local_shuffle(children[0]->need_to_local_shuffle());
-        }
+        _pipelines[pip_idx]->init_need_to_local_shuffle_by_source();
 
-        int idx = 0;
-        bool do_local_exchange = false;
-        do {
-            auto& ops = _pipelines[pip_idx]->operator_xs();
-            do_local_exchange = false;
-            for (; idx < ops.size();) {
-                if (ops[idx]->get_local_exchange_type() != ExchangeType::NOOP) 
{
-                    RETURN_IF_ERROR(_add_local_exchange(
-                            idx, ops[idx]->node_id(), 
_runtime_state->obj_pool(),
-                            _pipelines[pip_idx], 
ops[idx]->get_local_shuffle_exprs(),
-                            ops[idx]->get_local_exchange_type(), 
&do_local_exchange));
-                }
-                if (do_local_exchange) {
-                    idx = 2;
-                    break;
-                }
-                idx++;
+        RETURN_IF_ERROR(_plan_local_shuffle(pip_idx, _pipelines[pip_idx]));
+    }
+    return Status::OK();
+}
+
+Status PipelineXFragmentContext::_plan_local_shuffle(int pip_idx, PipelinePtr 
pip) {

Review Comment:
   warning: method '_plan_local_shuffle' can be made static 
[readability-convert-member-functions-to-static]
   
   be/src/pipeline/pipeline_x/pipeline_x_fragment_context.h:156:
   ```diff
   -     Status _plan_local_shuffle(int pip_idx, PipelinePtr pip);
   +     static Status _plan_local_shuffle(int pip_idx, PipelinePtr pip);
   ```
   



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