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


##########
be/src/pipeline/exec/exchange_sink_operator.cpp:
##########
@@ -203,6 +178,39 @@ Status ExchangeSinkLocalState::init(RuntimeState* state, 
LocalSinkStateInfo& inf
             }
         }
     }
+    return Status::OK();
+}
+
+Status ExchangeSinkLocalState::open(RuntimeState* state) {

Review Comment:
   warning: function 'open' has cognitive complexity of 60 (threshold 50) 
[readability-function-cognitive-complexity]
   ```cpp
   Status ExchangeSinkLocalState::open(RuntimeState* state) {
                                  ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/pipeline/exec/exchange_sink_operator.cpp:184:** +1, including 
nesting penalty of 0, nesting level increased to 1
   ```cpp
       RETURN_IF_ERROR(Base::open(state));
       ^
   ```
   **be/src/common/status.h:541:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:184:** +2, including 
nesting penalty of 1, nesting level increased to 2
   ```cpp
       RETURN_IF_ERROR(Base::open(state));
       ^
   ```
   **be/src/common/status.h:543:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:194:** +1, including 
nesting penalty of 0, nesting level increased to 1
   ```cpp
       if (_part_type == TPartitionType::UNPARTITIONED || _part_type == 
TPartitionType::RANDOM ||
       ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:213:** +1, including 
nesting penalty of 0, nesting level increased to 1
   ```cpp
       if (_part_type == TPartitionType::HASH_PARTITIONED) {
       ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:217:** +2, including 
nesting penalty of 1, nesting level increased to 2
   ```cpp
           RETURN_IF_ERROR(_partitioner->init(p._texprs));
           ^
   ```
   **be/src/common/status.h:541:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:217:** +3, including 
nesting penalty of 2, nesting level increased to 3
   ```cpp
           RETURN_IF_ERROR(_partitioner->init(p._texprs));
           ^
   ```
   **be/src/common/status.h:543:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:218:** +2, including 
nesting penalty of 1, nesting level increased to 2
   ```cpp
           RETURN_IF_ERROR(_partitioner->prepare(state, p._row_desc));
           ^
   ```
   **be/src/common/status.h:541:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:218:** +3, including 
nesting penalty of 2, nesting level increased to 3
   ```cpp
           RETURN_IF_ERROR(_partitioner->prepare(state, p._row_desc));
           ^
   ```
   **be/src/common/status.h:543:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:221:** +1, nesting level 
increased to 1
   ```cpp
       } else if (_part_type == 
TPartitionType::BUCKET_SHFFULE_HASH_PARTITIONED) {
              ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:225:** +2, including 
nesting penalty of 1, nesting level increased to 2
   ```cpp
           RETURN_IF_ERROR(_partitioner->init(p._texprs));
           ^
   ```
   **be/src/common/status.h:541:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:225:** +3, including 
nesting penalty of 2, nesting level increased to 3
   ```cpp
           RETURN_IF_ERROR(_partitioner->init(p._texprs));
           ^
   ```
   **be/src/common/status.h:543:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:226:** +2, including 
nesting penalty of 1, nesting level increased to 2
   ```cpp
           RETURN_IF_ERROR(_partitioner->prepare(state, p._row_desc));
           ^
   ```
   **be/src/common/status.h:541:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:226:** +3, including 
nesting penalty of 2, nesting level increased to 3
   ```cpp
           RETURN_IF_ERROR(_partitioner->prepare(state, p._row_desc));
           ^
   ```
   **be/src/common/status.h:543:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:229:** +1, nesting level 
increased to 1
   ```cpp
       } else if (_part_type == 
TPartitionType::TABLET_SINK_SHUFFLE_PARTITIONED) {
              ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:235:** +2, including 
nesting penalty of 1, nesting level increased to 2
   ```cpp
           RETURN_IF_ERROR(_schema->init(p._tablet_sink_schema));
           ^
   ```
   **be/src/common/status.h:541:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:235:** +3, including 
nesting penalty of 2, nesting level increased to 3
   ```cpp
           RETURN_IF_ERROR(_schema->init(p._tablet_sink_schema));
           ^
   ```
   **be/src/common/status.h:543:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:237:** +2, including 
nesting penalty of 1, nesting level increased to 2
   ```cpp
           RETURN_IF_ERROR(_vpartition->init());
           ^
   ```
   **be/src/common/status.h:541:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:237:** +3, including 
nesting penalty of 2, nesting level increased to 3
   ```cpp
           RETURN_IF_ERROR(_vpartition->init());
           ^
   ```
   **be/src/common/status.h:543:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:260:** +1, nesting level 
increased to 1
   ```cpp
       } else if (_part_type == TPartitionType::TABLE_SINK_HASH_PARTITIONED) {
              ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:277:** +2, including 
nesting penalty of 1, nesting level increased to 2
   ```cpp
           RETURN_IF_ERROR(_partitioner->init(p._texprs));
           ^
   ```
   **be/src/common/status.h:541:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:277:** +3, including 
nesting penalty of 2, nesting level increased to 3
   ```cpp
           RETURN_IF_ERROR(_partitioner->init(p._texprs));
           ^
   ```
   **be/src/common/status.h:543:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:278:** +2, including 
nesting penalty of 1, nesting level increased to 2
   ```cpp
           RETURN_IF_ERROR(_partitioner->prepare(state, p._row_desc));
           ^
   ```
   **be/src/common/status.h:541:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:278:** +3, including 
nesting penalty of 2, nesting level increased to 3
   ```cpp
           RETURN_IF_ERROR(_partitioner->prepare(state, p._row_desc));
           ^
   ```
   **be/src/common/status.h:543:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:284:** +1, including 
nesting penalty of 0, nesting level increased to 1
   ```cpp
       if (_part_type == TPartitionType::HASH_PARTITIONED ||
       ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:287:** +2, including 
nesting penalty of 1, nesting level increased to 2
   ```cpp
           RETURN_IF_ERROR(_partitioner->open(state));
           ^
   ```
   **be/src/common/status.h:541:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:287:** +3, including 
nesting penalty of 2, nesting level increased to 3
   ```cpp
           RETURN_IF_ERROR(_partitioner->open(state));
           ^
   ```
   **be/src/common/status.h:543:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:288:** +1, nesting level 
increased to 1
   ```cpp
       } else if (_part_type == 
TPartitionType::TABLET_SINK_SHUFFLE_PARTITIONED) {
              ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:289:** +2, including 
nesting penalty of 1, nesting level increased to 2
   ```cpp
           RETURN_IF_ERROR(_row_distribution.open(_tablet_sink_row_desc));
           ^
   ```
   **be/src/common/status.h:541:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:289:** +3, including 
nesting penalty of 2, nesting level increased to 3
   ```cpp
           RETURN_IF_ERROR(_row_distribution.open(_tablet_sink_row_desc));
           ^
   ```
   **be/src/common/status.h:543:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   
   </details>
   



##########
be/src/pipeline/exec/exchange_sink_operator.cpp:
##########
@@ -203,6 +178,39 @@
             }
         }
     }
+    return Status::OK();
+}
+
+Status ExchangeSinkLocalState::open(RuntimeState* state) {

Review Comment:
   warning: function 'open' exceeds recommended size/complexity thresholds 
[readability-function-size]
   ```cpp
   Status ExchangeSinkLocalState::open(RuntimeState* state) {
                                  ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/pipeline/exec/exchange_sink_operator.cpp:183:** 109 lines including 
whitespace and comments (threshold 80)
   ```cpp
   Status ExchangeSinkLocalState::open(RuntimeState* state) {
                                  ^
   ```
   
   </details>
   



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