github-actions[bot] commented on code in PR #35347: URL: https://github.com/apache/doris/pull/35347#discussion_r1615077113
########## be/src/vec/sink/writer/vhive_table_writer.cpp: ########## @@ -82,8 +82,17 @@ Status VHiveTableWriter::open(RuntimeState* state, RuntimeProfile* profile) { Status VHiveTableWriter::write(vectorized::Block& block) { Review Comment: warning: function 'write' has cognitive complexity of 83 (threshold 50) [readability-function-cognitive-complexity] ```cpp Status VHiveTableWriter::write(vectorized::Block& block) { ^ ``` <details> <summary>Additional context</summary> **be/src/vec/sink/writer/vhive_table_writer.cpp:85:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp if (block.rows() == 0) { ^ ``` **be/src/vec/sink/writer/vhive_table_writer.cpp:89:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp RETURN_IF_ERROR(vectorized::VExprContext::get_output_block_after_execute_exprs( ^ ``` **be/src/common/status.h:614:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/vec/sink/writer/vhive_table_writer.cpp:89:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp RETURN_IF_ERROR(vectorized::VExprContext::get_output_block_after_execute_exprs( ^ ``` **be/src/common/status.h:616:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/vec/sink/writer/vhive_table_writer.cpp:97:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp if (_partition_columns_input_index.empty()) { ^ ``` **be/src/vec/sink/writer/vhive_table_writer.cpp:102:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp if (writer_iter == _partitions_to_writers.end()) { ^ ``` **be/src/vec/sink/writer/vhive_table_writer.cpp:105:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp } catch (doris::Exception& e) { ^ ``` **be/src/vec/sink/writer/vhive_table_writer.cpp:109:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp RETURN_IF_ERROR(writer->open(_state, _profile)); ^ ``` **be/src/common/status.h:614:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/vec/sink/writer/vhive_table_writer.cpp:109:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp RETURN_IF_ERROR(writer->open(_state, _profile)); ^ ``` **be/src/common/status.h:616:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/vec/sink/writer/vhive_table_writer.cpp:110:** +1, nesting level increased to 2 ```cpp } else { ^ ``` **be/src/vec/sink/writer/vhive_table_writer.cpp:111:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp if (writer_iter->second->written_len() > config::hive_sink_max_file_size) { ^ ``` **be/src/vec/sink/writer/vhive_table_writer.cpp:122:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp } catch (doris::Exception& e) { ^ ``` **be/src/vec/sink/writer/vhive_table_writer.cpp:126:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp RETURN_IF_ERROR(writer->open(_state, _profile)); ^ ``` **be/src/common/status.h:614:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/vec/sink/writer/vhive_table_writer.cpp:126:** +5, including nesting penalty of 4, nesting level increased to 5 ```cpp RETURN_IF_ERROR(writer->open(_state, _profile)); ^ ``` **be/src/common/status.h:616:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/vec/sink/writer/vhive_table_writer.cpp:127:** +1, nesting level increased to 3 ```cpp } else { ^ ``` **be/src/vec/sink/writer/vhive_table_writer.cpp:134:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp RETURN_IF_ERROR(writer->write(output_block)); ^ ``` **be/src/common/status.h:614:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/vec/sink/writer/vhive_table_writer.cpp:134:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp RETURN_IF_ERROR(writer->write(output_block)); ^ ``` **be/src/common/status.h:616:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/vec/sink/writer/vhive_table_writer.cpp:140:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp for (int i = 0; i < output_block.rows(); ++i) { ^ ``` **be/src/vec/sink/writer/vhive_table_writer.cpp:144:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp } catch (doris::Exception& e) { ^ ``` **be/src/vec/sink/writer/vhive_table_writer.cpp:151:** nesting level increased to 2 ```cpp [&](const std::string& partition_name, int position, ^ ``` **be/src/vec/sink/writer/vhive_table_writer.cpp:157:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp RETURN_IF_ERROR(writer->open(_state, _profile)); ^ ``` **be/src/common/status.h:614:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/vec/sink/writer/vhive_table_writer.cpp:157:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp RETURN_IF_ERROR(writer->open(_state, _profile)); ^ ``` **be/src/common/status.h:616:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/vec/sink/writer/vhive_table_writer.cpp:163:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp } catch (doris::Exception& e) { ^ ``` **be/src/vec/sink/writer/vhive_table_writer.cpp:170:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp if (writer_iter == _partitions_to_writers.end()) { ^ ``` **be/src/vec/sink/writer/vhive_table_writer.cpp:172:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp if (_partitions_to_writers.size() + 1 > ^ ``` **be/src/vec/sink/writer/vhive_table_writer.cpp:178:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp RETURN_IF_ERROR(create_and_open_writer(partition_name, i, nullptr, 0, writer)); ^ ``` **be/src/common/status.h:614:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/vec/sink/writer/vhive_table_writer.cpp:178:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp RETURN_IF_ERROR(create_and_open_writer(partition_name, i, nullptr, 0, writer)); ^ ``` **be/src/common/status.h:616:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/vec/sink/writer/vhive_table_writer.cpp:179:** +1, nesting level increased to 2 ```cpp } else { ^ ``` **be/src/vec/sink/writer/vhive_table_writer.cpp:181:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp if (writer_iter->second->written_len() > config::hive_sink_max_file_size) { ^ ``` **be/src/vec/sink/writer/vhive_table_writer.cpp:190:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp RETURN_IF_ERROR(create_and_open_writer(partition_name, i, &file_name, ^ ``` **be/src/common/status.h:614:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/vec/sink/writer/vhive_table_writer.cpp:190:** +5, including nesting penalty of 4, nesting level increased to 5 ```cpp RETURN_IF_ERROR(create_and_open_writer(partition_name, i, &file_name, ^ ``` **be/src/common/status.h:616:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/vec/sink/writer/vhive_table_writer.cpp:192:** +1, nesting level increased to 3 ```cpp } else { ^ ``` **be/src/vec/sink/writer/vhive_table_writer.cpp:196:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp if (writer_pos_iter == writer_positions.end()) { ^ ``` **be/src/vec/sink/writer/vhive_table_writer.cpp:200:** +1, nesting level increased to 3 ```cpp } else { ^ ``` </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