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


##########
be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:
##########
@@ -577,19 +579,301 @@ Status 
VerticalSegmentWriter::_append_block_with_partial_content(RowsInBlock& da
     return Status::OK();
 }
 
+Status VerticalSegmentWriter::_append_block_with_flexible_partial_content(

Review Comment:
   warning: function '_append_block_with_flexible_partial_content' has 
cognitive complexity of 69 (threshold 50) 
[readability-function-cognitive-complexity]
   ```cpp
   Status VerticalSegmentWriter::_append_block_with_flexible_partial_content(
                                 ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:599:** +1, 
including nesting penalty of 0, nesting level increased to 1
   ```cpp
       for (std::size_t cid {0}; cid < _num_sort_key_columns; cid++) {
       ^
   ```
   **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:601:** +2, 
including nesting penalty of 1, nesting level increased to 2
   ```cpp
           
RETURN_IF_ERROR(_olap_data_convertor->set_source_content_with_specifid_column(
           ^
   ```
   **be/src/common/status.h:628:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:601:** +3, 
including nesting penalty of 2, nesting level increased to 3
   ```cpp
           
RETURN_IF_ERROR(_olap_data_convertor->set_source_content_with_specifid_column(
           ^
   ```
   **be/src/common/status.h:630:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:604:** +2, 
including nesting penalty of 1, nesting level increased to 2
   ```cpp
           if (!status.ok()) {
           ^
   ```
   **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:609:** +2, 
including nesting penalty of 1, nesting level increased to 2
   ```cpp
           RETURN_IF_ERROR(_column_writers[cid]->append(column->get_nullmap(), 
column->get_data(),
           ^
   ```
   **be/src/common/status.h:628:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:609:** +3, 
including nesting penalty of 2, nesting level increased to 3
   ```cpp
           RETURN_IF_ERROR(_column_writers[cid]->append(column->get_nullmap(), 
column->get_data(),
           ^
   ```
   **be/src/common/status.h:630:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:623:** +1, 
including nesting penalty of 0, nesting level increased to 1
   ```cpp
       if (schema_has_sequence_col) {
       ^
   ```
   **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:626:** +2, 
including nesting penalty of 1, nesting level increased to 2
   ```cpp
           
RETURN_IF_ERROR(_olap_data_convertor->set_source_content_with_specifid_column(
           ^
   ```
   **be/src/common/status.h:628:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:626:** +3, 
including nesting penalty of 2, nesting level increased to 3
   ```cpp
           
RETURN_IF_ERROR(_olap_data_convertor->set_source_content_with_specifid_column(
           ^
   ```
   **be/src/common/status.h:630:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:630:** +2, 
including nesting penalty of 1, nesting level increased to 2
   ```cpp
           if (!status.ok()) {
           ^
   ```
   **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:655:** +1, 
including nesting penalty of 0, nesting level increased to 1
   ```cpp
           
DBUG_EXECUTE_IF("VerticalSegmentWriter._append_block_with_flexible_partial_content.sleep",
           ^
   ```
   **be/src/util/debug_points.h:36:** expanded from macro 'DBUG_EXECUTE_IF'
   ```cpp
       if (UNLIKELY(config::enable_debug_points)) {                             
 \
       ^
   ```
   **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:655:** +2, 
including nesting penalty of 1, nesting level increased to 2
   ```cpp
           
DBUG_EXECUTE_IF("VerticalSegmentWriter._append_block_with_flexible_partial_content.sleep",
           ^
   ```
   **be/src/util/debug_points.h:38:** expanded from macro 'DBUG_EXECUTE_IF'
   ```cpp
           if (dp) {                                                            
 \
           ^
   ```
   **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:659:** +1, 
including nesting penalty of 0, nesting level increased to 1
   ```cpp
           if (specified_rowsets.size() != _mow_context->rowset_ids.size()) {
           ^
   ```
   **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:668:** +2, 
including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if (_opts.rowset_ctx->partial_update_info->is_strict_mode) {
               ^
   ```
   **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:684:** +1, 
including nesting penalty of 0, nesting level increased to 1
   ```cpp
       for (size_t block_pos = data.row_pos; block_pos < data.row_pos + 
data.num_rows; block_pos++) {
       ^
   ```
   **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:696:** +2, 
including nesting penalty of 1, nesting level increased to 2
   ```cpp
           if (seq_map_col_unique_id != -1) {
           ^
   ```
   **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:698:** +3, 
including nesting penalty of 2, nesting level increased to 3
   ```cpp
               if (skip_bitmap.contains(seq_map_col_unique_id)) {
               ^
   ```
   **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:706:** +1
   ```cpp
                   (schema_has_sequence_col && 
!skip_bitmap.contains(seq_col_unique_id));
                                            ^
   ```
   **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:707:** +2, 
including nesting penalty of 1, nesting level increased to 2
   ```cpp
           if (row_has_sequence_col) {
           ^
   ```
   **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:712:** +1
   ```cpp
           bool have_delete_sign = 
(!skip_bitmap.contains(delete_sign_col_unique_id) &&
                                                                                
     ^
   ```
   **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:720:** +2, 
including nesting penalty of 1, nesting level increased to 2
   ```cpp
           if (st.is<KEY_NOT_FOUND>()) {
           ^
   ```
   **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:721:** +3, 
including nesting penalty of 2, nesting level increased to 3
   ```cpp
               if (_opts.rowset_ctx->partial_update_info->is_strict_mode) {
               ^
   ```
   **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:727:** +1, 
nesting level increased to 3
   ```cpp
               } else {
                 ^
   ```
   **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:739:** +4, 
including nesting penalty of 3, nesting level increased to 4
   ```cpp
                   if (!can_insert_new_rows_in_partial_update) {
                   ^
   ```
   **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:752:** +2, 
including nesting penalty of 1, nesting level increased to 2
   ```cpp
           if (!st.ok() && !st.is<KEY_ALREADY_EXISTS>()) {
           ^
   ```
   **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:762:** +2, 
including nesting penalty of 1, nesting level increased to 2
   ```cpp
           if (have_delete_sign && !schema_has_sequence_col) {
           ^
   ```
   **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:762:** +1
   ```cpp
           if (have_delete_sign && !schema_has_sequence_col) {
                                ^
   ```
   **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:765:** +1, 
nesting level increased to 2
   ```cpp
           } else {
             ^
   ```
   **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:772:** +2, 
including nesting penalty of 1, nesting level increased to 2
   ```cpp
           if (st.is<KEY_ALREADY_EXISTS>()) {
           ^
   ```
   **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:779:** +1, 
nesting level increased to 2
   ```cpp
           } else {
             ^
   ```
   **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:787:** +1, 
including nesting penalty of 0, nesting level increased to 1
   ```cpp
       if (config::enable_merge_on_write_correctness_check) {
       ^
   ```
   **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:793:** +1, 
including nesting penalty of 0, nesting level increased to 1
   ```cpp
       RETURN_IF_ERROR(read_plan.fill_non_sort_key_columns(
       ^
   ```
   **be/src/common/status.h:628:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:793:** +2, 
including nesting penalty of 1, nesting level increased to 2
   ```cpp
       RETURN_IF_ERROR(read_plan.fill_non_sort_key_columns(
       ^
   ```
   **be/src/common/status.h:630:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:828:** +1, 
including nesting penalty of 0, nesting level increased to 1
   ```cpp
       if (_num_rows_written != data.row_pos ||
       ^
   ```
   **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:837:** +1, 
including nesting penalty of 0, nesting level increased to 1
   ```cpp
       for (size_t block_pos = data.row_pos; block_pos < data.row_pos + 
data.num_rows; block_pos++) {
       ^
   ```
   **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:840:** +2, 
including nesting penalty of 1, nesting level increased to 2
   ```cpp
           if (schema_has_sequence_col) {
           ^
   ```
   **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:843:** +2, 
including nesting penalty of 1, nesting level increased to 2
   ```cpp
           RETURN_IF_ERROR(_primary_key_index_builder->add_item(key));
           ^
   ```
   **be/src/common/status.h:628:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:843:** +3, 
including nesting penalty of 2, nesting level increased to 3
   ```cpp
           RETURN_IF_ERROR(_primary_key_index_builder->add_item(key));
           ^
   ```
   **be/src/common/status.h:630:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   
   </details>
   



##########
be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:
##########
@@ -577,19 +579,301 @@
     return Status::OK();
 }
 
+Status VerticalSegmentWriter::_append_block_with_flexible_partial_content(

Review Comment:
   warning: function '_append_block_with_flexible_partial_content' exceeds 
recommended size/complexity thresholds [readability-function-size]
   ```cpp
   Status VerticalSegmentWriter::_append_block_with_flexible_partial_content(
                                 ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:581:** 270 lines 
including whitespace and comments (threshold 80)
   ```cpp
   Status VerticalSegmentWriter::_append_block_with_flexible_partial_content(
                                 ^
   ```
   
   </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