github-actions[bot] commented on code in PR #39756:
URL: https://github.com/apache/doris/pull/39756#discussion_r1726198670
##########
be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:
##########
@@ -577,19 +579,290 @@
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:** 268 lines
including whitespace and comments (threshold 80)
```cpp
Status VerticalSegmentWriter::_append_block_with_flexible_partial_content(
^
```
</details>
##########
be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:
##########
@@ -577,19 +579,290 @@ 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 63 (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:622:** +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:625:** +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:625:** +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:629:** +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:651:** +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:651:** +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:655:** +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:664:** +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:680:** +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:** +1
```cpp
(schema_has_sequence_col &&
!skip_bitmap.contains(seq_col_unique_id));
^
```
**be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:697:** +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:709:** +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:710:** +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:716:** +1,
nesting level increased to 3
```cpp
} else {
^
```
**be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:728:** +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:741:** +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:751:** +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:751:** +1
```cpp
if (have_delete_sign && !schema_has_sequence_col) {
^
```
**be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:754:** +1,
nesting level increased to 2
```cpp
} else {
^
```
**be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:761:** +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:768:** +1,
nesting level increased to 2
```cpp
} else {
^
```
**be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:776:** +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:791:** +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:791:** +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:826:** +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:835:** +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:838:** +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:841:** +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:841:** +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>
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]