You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "morrySnow (via GitHub)" <gi...@apache.org> on 2024/02/19 01:49:31 UTC

[PR] [feature](sink) data shuffled by tablet id before sink [doris]

morrySnow opened a new pull request, #31081:
URL: https://github.com/apache/doris/pull/31081

   ## Proposed changes
   
   Issue Number: close #xxx
   
   <!--Describe your changes.-->
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
   
   


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


Re: [PR] [feature](sink) data shuffled by tablet id before sink [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #31081:
URL: https://github.com/apache/doris/pull/31081#issuecomment-1951559565

   Thank you for your contribution to Apache Doris.
   Don't know what should be done next? See [How to process your PR](https://cwiki.apache.org/confluence/display/DORIS/How+to+process+your+PR)


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


Re: [PR] [feature](sink) data shuffled by tablet id before sink [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on code in PR #31081:
URL: https://github.com/apache/doris/pull/31081#discussion_r1493924936


##########
be/src/vec/sink/vdata_stream_sender.h:
##########
@@ -402,12 +418,20 @@ Status VDataStreamSender::channel_add_rows(RuntimeState* state, Channels& channe
                                            int num_channels,
                                            const HashValueType* __restrict channel_ids, int rows,
                                            Block* block, bool eos) {
-    std::vector<uint32_t> channel2rows[num_channels];
-
+    std::vector<std::vector<uint32_t>> channel2rows;
+    channel2rows.resize(num_channels);
     for (uint32_t i = 0; i < rows; i++) {
         channel2rows[channel_ids[i]].emplace_back(i);
     }
+    RETURN_IF_ERROR(
+            channel_add_rows_with_idx(state, channels, num_channels, channel2rows, block, eos));
+    return Status::OK();
+}
 
+template <typename Channels>
+Status VDataStreamSender::channel_add_rows_with_idx(

Review Comment:
   warning: function 'channel_add_rows_with_idx' has cognitive complexity of 52 (threshold 50) [readability-function-cognitive-complexity]
   ```cpp
   Status VDataStreamSender::channel_add_rows_with_idx(
                             ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/vec/sink/vdata_stream_sender.h:435:** +1, including nesting penalty of 0, nesting level increased to 1
   ```cpp
       for (int i = 0; i < num_channels; ++i) {
       ^
   ```
   **be/src/vec/sink/vdata_stream_sender.h:436:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
           if (!channels[i]->is_receiver_eof() && !channel2rows[i].empty()) {
           ^
   ```
   **be/src/vec/sink/vdata_stream_sender.h:436:** +1
   ```cpp
           if (!channels[i]->is_receiver_eof() && !channel2rows[i].empty()) {
                                               ^
   ```
   **be/src/vec/sink/vdata_stream_sender.h:438:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
               HANDLE_CHANNEL_STATUS(state, channels[i], status);
               ^
   ```
   **be/src/vec/sink/vdata_stream_sender.h:407:** expanded from macro 'HANDLE_CHANNEL_STATUS'
   ```cpp
       do {                                                 \
       ^
   ```
   **be/src/vec/sink/vdata_stream_sender.h:438:** +4, including nesting penalty of 3, nesting level increased to 4
   ```cpp
               HANDLE_CHANNEL_STATUS(state, channels[i], status);
               ^
   ```
   **be/src/vec/sink/vdata_stream_sender.h:408:** expanded from macro 'HANDLE_CHANNEL_STATUS'
   ```cpp
           if (status.is<ErrorCode::END_OF_FILE>()) {       \
           ^
   ```
   **be/src/vec/sink/vdata_stream_sender.h:438:** +1, nesting level increased to 4
   ```cpp
               HANDLE_CHANNEL_STATUS(state, channels[i], status);
               ^
   ```
   **be/src/vec/sink/vdata_stream_sender.h:410:** expanded from macro 'HANDLE_CHANNEL_STATUS'
   ```cpp
           } else {                                         \
             ^
   ```
   **be/src/vec/sink/vdata_stream_sender.h:438:** +5, including nesting penalty of 4, nesting level increased to 5
   ```cpp
               HANDLE_CHANNEL_STATUS(state, channels[i], status);
               ^
   ```
   **be/src/vec/sink/vdata_stream_sender.h:411:** expanded from macro 'HANDLE_CHANNEL_STATUS'
   ```cpp
               RETURN_IF_ERROR(status);                     \
               ^
   ```
   **be/src/common/status.h:541:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/vec/sink/vdata_stream_sender.h:438:** +6, including nesting penalty of 5, nesting level increased to 6
   ```cpp
               HANDLE_CHANNEL_STATUS(state, channels[i], status);
               ^
   ```
   **be/src/vec/sink/vdata_stream_sender.h:411:** expanded from macro 'HANDLE_CHANNEL_STATUS'
   ```cpp
               RETURN_IF_ERROR(status);                     \
               ^
   ```
   **be/src/common/status.h:543:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/vec/sink/vdata_stream_sender.h:442:** +1, including nesting penalty of 0, nesting level increased to 1
   ```cpp
       if (eos) {
       ^
   ```
   **be/src/vec/sink/vdata_stream_sender.h:443:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
           for (int i = 0; i < num_channels; ++i) {
           ^
   ```
   **be/src/vec/sink/vdata_stream_sender.h:444:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
               if (!channels[i]->is_receiver_eof()) {
               ^
   ```
   **be/src/vec/sink/vdata_stream_sender.h:446:** +4, including nesting penalty of 3, nesting level increased to 4
   ```cpp
                   HANDLE_CHANNEL_STATUS(state, channels[i], status);
                   ^
   ```
   **be/src/vec/sink/vdata_stream_sender.h:407:** expanded from macro 'HANDLE_CHANNEL_STATUS'
   ```cpp
       do {                                                 \
       ^
   ```
   **be/src/vec/sink/vdata_stream_sender.h:446:** +5, including nesting penalty of 4, nesting level increased to 5
   ```cpp
                   HANDLE_CHANNEL_STATUS(state, channels[i], status);
                   ^
   ```
   **be/src/vec/sink/vdata_stream_sender.h:408:** expanded from macro 'HANDLE_CHANNEL_STATUS'
   ```cpp
           if (status.is<ErrorCode::END_OF_FILE>()) {       \
           ^
   ```
   **be/src/vec/sink/vdata_stream_sender.h:446:** +1, nesting level increased to 5
   ```cpp
                   HANDLE_CHANNEL_STATUS(state, channels[i], status);
                   ^
   ```
   **be/src/vec/sink/vdata_stream_sender.h:410:** expanded from macro 'HANDLE_CHANNEL_STATUS'
   ```cpp
           } else {                                         \
             ^
   ```
   **be/src/vec/sink/vdata_stream_sender.h:446:** +6, including nesting penalty of 5, nesting level increased to 6
   ```cpp
                   HANDLE_CHANNEL_STATUS(state, channels[i], status);
                   ^
   ```
   **be/src/vec/sink/vdata_stream_sender.h:411:** expanded from macro 'HANDLE_CHANNEL_STATUS'
   ```cpp
               RETURN_IF_ERROR(status);                     \
               ^
   ```
   **be/src/common/status.h:541:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/vec/sink/vdata_stream_sender.h:446:** +7, including nesting penalty of 6, nesting level increased to 7
   ```cpp
                   HANDLE_CHANNEL_STATUS(state, channels[i], status);
                   ^
   ```
   **be/src/vec/sink/vdata_stream_sender.h:411:** expanded from macro 'HANDLE_CHANNEL_STATUS'
   ```cpp
               RETURN_IF_ERROR(status);                     \
               ^
   ```
   **be/src/common/status.h:543:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   
   </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-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


Re: [PR] [feature](sink) data shuffled by tablet id before sink [doris]

Posted by "morrySnow (via GitHub)" <gi...@apache.org>.
morrySnow closed pull request #31081: [feature](sink) data shuffled by tablet id before sink
URL: https://github.com/apache/doris/pull/31081


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