github-actions[bot] commented on code in PR #39756: URL: https://github.com/apache/doris/pull/39756#discussion_r1734236327
########## be/src/olap/base_tablet.cpp: ########## @@ -985,12 +996,111 @@ Status BaseTablet::generate_new_block_for_partial_update( mutable_column->insert_default(); } } else { - mutable_column->insert_from( - *old_block.get_columns_with_type_and_name()[i].column.get(), - read_index_old[idx]); + mutable_column->insert_from(*old_block.get_by_position(i).column, + read_index_old[idx]); + } + } + } + output_block->set_columns(std::move(full_mutable_columns)); + VLOG_DEBUG << "full block when publish: " << output_block->dump_data(); + return Status::OK(); +} + +Status BaseTablet::generate_new_block_for_flexible_partial_update( Review Comment: warning: function 'generate_new_block_for_flexible_partial_update' exceeds recommended size/complexity thresholds [readability-function-size] ```cpp Status BaseTablet::generate_new_block_for_flexible_partial_update( ^ ``` <details> <summary>Additional context</summary> **be/src/olap/base_tablet.cpp:1008:** 94 lines including whitespace and comments (threshold 80) ```cpp Status BaseTablet::generate_new_block_for_flexible_partial_update( ^ ``` </details> ########## be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp: ########## @@ -578,19 +580,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:600:** +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:602:** +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:602:** +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:605:** +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:610:** +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:610:** +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:624:** +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:627:** +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:627:** +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:631:** +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:656:** +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:656:** +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:660:** +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:669:** +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:685:** +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:697:** +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:699:** +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:707:** +1 ```cpp (schema_has_sequence_col && !skip_bitmap.contains(seq_col_unique_id)); ^ ``` **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:708:** +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:713:** +1 ```cpp bool have_delete_sign = (!skip_bitmap.contains(delete_sign_col_unique_id) && ^ ``` **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:721:** +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:722:** +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:728:** +1, nesting level increased to 3 ```cpp } else { ^ ``` **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:740:** +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:753:** +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:763:** +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:763:** +1 ```cpp if (have_delete_sign && !schema_has_sequence_col) { ^ ``` **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:766:** +1, nesting level increased to 2 ```cpp } else { ^ ``` **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:773:** +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:780:** +1, nesting level increased to 2 ```cpp } else { ^ ``` **be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:788:** +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:794:** +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:794:** +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:829:** +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:838:** +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:841:** +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:844:** +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:844:** +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: ########## @@ -578,19 +580,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:582:** 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