github-actions[bot] commented on code in PR #45655: URL: https://github.com/apache/doris/pull/45655#discussion_r1891559534
########## be/src/vec/exprs/vcompound_pred.h: ########## @@ -144,15 +144,13 @@ class VCompoundPred : public VectorizedFnCall { } if (all_pass && !res.is_empty()) { - // set fast_execute when expr evaluated by inverted index correctly - _can_fast_execute = true; context->get_inverted_index_context()->set_inverted_index_result_for_expr(this, res); } return Status::OK(); } Status execute(VExprContext* context, Block* block, int* result_column_id) override { Review Comment: warning: function 'execute' has cognitive complexity of 111 (threshold 50) [readability-function-cognitive-complexity] ```cpp Status execute(VExprContext* context, Block* block, int* result_column_id) override { ^ ``` <details> <summary>Additional context</summary> **be/src/vec/exprs/vcompound_pred.h:152:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp if (fast_execute(context, block, result_column_id)) { ^ ``` **be/src/vec/exprs/vcompound_pred.h:155:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp if (children().size() == 1 || !_all_child_is_compound_and_not_const()) { ^ ``` **be/src/vec/exprs/vcompound_pred.h:161:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp RETURN_IF_ERROR(_children[0]->execute(context, block, &lhs_id)); ^ ``` **be/src/common/status.h:632:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/vec/exprs/vcompound_pred.h:161:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp RETURN_IF_ERROR(_children[0]->execute(context, block, &lhs_id)); ^ ``` **be/src/common/status.h:634:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/vec/exprs/vcompound_pred.h:173:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp if (lhs_is_nullable) { ^ ``` **be/src/vec/exprs/vcompound_pred.h:187:** nesting level increased to 1 ```cpp auto get_rhs_colum = [&]() { ^ ``` **be/src/vec/exprs/vcompound_pred.h:188:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp if (rhs_id == -1) { ^ ``` **be/src/vec/exprs/vcompound_pred.h:189:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp RETURN_IF_ERROR(_children[1]->execute(context, block, &rhs_id)); ^ ``` **be/src/common/status.h:632:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/vec/exprs/vcompound_pred.h:189:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp RETURN_IF_ERROR(_children[1]->execute(context, block, &rhs_id)); ^ ``` **be/src/common/status.h:634:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/vec/exprs/vcompound_pred.h:199:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp if (rhs_is_nullable) { ^ ``` **be/src/vec/exprs/vcompound_pred.h:207:** nesting level increased to 1 ```cpp auto return_result_column_id = [&](ColumnPtr res_column, int res_id) -> int { ^ ``` **be/src/vec/exprs/vcompound_pred.h:208:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp if (result_is_nullable && !res_column->is_nullable()) { ^ ``` **be/src/vec/exprs/vcompound_pred.h:208:** +1 ```cpp if (result_is_nullable && !res_column->is_nullable()) { ^ ``` **be/src/vec/exprs/vcompound_pred.h:217:** nesting level increased to 1 ```cpp auto create_null_map_column = [&](ColumnPtr& null_map_column, ^ ``` **be/src/vec/exprs/vcompound_pred.h:219:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp if (null_map_data == nullptr) { ^ ``` **be/src/vec/exprs/vcompound_pred.h:228:** nesting level increased to 1 ```cpp auto vector_vector_null = [&]<bool is_and_op>() { ^ ``` **be/src/vec/exprs/vcompound_pred.h:238:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp if constexpr (is_and_op) { ^ ``` **be/src/vec/exprs/vcompound_pred.h:239:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp for (size_t i = 0; i < size; ++i) { ^ ``` **be/src/vec/exprs/vcompound_pred.h:244:** +1, nesting level increased to 2 ```cpp } else { ^ ``` **be/src/vec/exprs/vcompound_pred.h:245:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp for (size_t i = 0; i < size; ++i) { ^ ``` **be/src/vec/exprs/vcompound_pred.h:258:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp if (_op == TExprOpcode::COMPOUND_AND) { ^ ``` **be/src/vec/exprs/vcompound_pred.h:261:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false && lhs_all_is_not_null)) { ^ ``` **be/src/vec/exprs/vcompound_pred.h:261:** +1 ```cpp if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false && lhs_all_is_not_null)) { ^ ``` **be/src/vec/exprs/vcompound_pred.h:261:** +1 ```cpp if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false && lhs_all_is_not_null)) { ^ ``` **be/src/vec/exprs/vcompound_pred.h:261:** +1 ```cpp if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false && lhs_all_is_not_null)) { ^ ``` **be/src/vec/exprs/vcompound_pred.h:264:** +1, nesting level increased to 2 ```cpp } else { ^ ``` **be/src/vec/exprs/vcompound_pred.h:265:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp RETURN_IF_ERROR(get_rhs_colum()); ^ ``` **be/src/common/status.h:632:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/vec/exprs/vcompound_pred.h:265:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp RETURN_IF_ERROR(get_rhs_colum()); ^ ``` **be/src/common/status.h:634:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/vec/exprs/vcompound_pred.h:267:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp if ((lhs_all_true && !lhs_is_nullable) || //not null column ^ ``` **be/src/vec/exprs/vcompound_pred.h:267:** +1 ```cpp if ((lhs_all_true && !lhs_is_nullable) || //not null column ^ ``` **be/src/vec/exprs/vcompound_pred.h:267:** +1 ```cpp if ((lhs_all_true && !lhs_is_nullable) || //not null column ^ ``` **be/src/vec/exprs/vcompound_pred.h:268:** +1 ```cpp (lhs_all_true && lhs_all_is_not_null)) { //nullable column ^ ``` **be/src/vec/exprs/vcompound_pred.h:271:** +1, nesting level increased to 3 ```cpp } else if ((rhs_all_false && !rhs_is_nullable) || ^ ``` **be/src/vec/exprs/vcompound_pred.h:271:** +1 ```cpp } else if ((rhs_all_false && !rhs_is_nullable) || ^ ``` **be/src/vec/exprs/vcompound_pred.h:271:** +1 ```cpp } else if ((rhs_all_false && !rhs_is_nullable) || ^ ``` **be/src/vec/exprs/vcompound_pred.h:272:** +1 ```cpp (rhs_all_false && rhs_all_is_not_null)) { ^ ``` **be/src/vec/exprs/vcompound_pred.h:275:** +1, nesting level increased to 3 ```cpp } else if ((rhs_all_true && !rhs_is_nullable) || ^ ``` **be/src/vec/exprs/vcompound_pred.h:275:** +1 ```cpp } else if ((rhs_all_true && !rhs_is_nullable) || ^ ``` **be/src/vec/exprs/vcompound_pred.h:275:** +1 ```cpp } else if ((rhs_all_true && !rhs_is_nullable) || ^ ``` **be/src/vec/exprs/vcompound_pred.h:276:** +1 ```cpp (rhs_all_true && rhs_all_is_not_null)) { ^ ``` **be/src/vec/exprs/vcompound_pred.h:279:** +1, nesting level increased to 3 ```cpp } else { ^ ``` **be/src/vec/exprs/vcompound_pred.h:280:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp if (!result_is_nullable) { ^ ``` **be/src/vec/exprs/vcompound_pred.h:282:** +5, including nesting penalty of 4, nesting level increased to 5 ```cpp for (size_t i = 0; i < size; i++) { ^ ``` **be/src/vec/exprs/vcompound_pred.h:285:** +1, nesting level increased to 4 ```cpp } else { ^ ``` **be/src/vec/exprs/vcompound_pred.h:290:** +1, nesting level increased to 1 ```cpp } else if (_op == TExprOpcode::COMPOUND_OR) { ^ ``` **be/src/vec/exprs/vcompound_pred.h:293:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp if ((lhs_all_true && !lhs_is_nullable) || (lhs_all_true && lhs_all_is_not_null)) { ^ ``` **be/src/vec/exprs/vcompound_pred.h:293:** +1 ```cpp if ((lhs_all_true && !lhs_is_nullable) || (lhs_all_true && lhs_all_is_not_null)) { ^ ``` **be/src/vec/exprs/vcompound_pred.h:293:** +1 ```cpp if ((lhs_all_true && !lhs_is_nullable) || (lhs_all_true && lhs_all_is_not_null)) { ^ ``` **be/src/vec/exprs/vcompound_pred.h:293:** +1 ```cpp if ((lhs_all_true && !lhs_is_nullable) || (lhs_all_true && lhs_all_is_not_null)) { ^ ``` **be/src/vec/exprs/vcompound_pred.h:296:** +1, nesting level increased to 2 ```cpp } else { ^ ``` **be/src/vec/exprs/vcompound_pred.h:297:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp RETURN_IF_ERROR(get_rhs_colum()); ^ ``` **be/src/common/status.h:632:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/vec/exprs/vcompound_pred.h:297:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp RETURN_IF_ERROR(get_rhs_colum()); ^ ``` **be/src/common/status.h:634:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/vec/exprs/vcompound_pred.h:298:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false && lhs_all_is_not_null)) { ^ ``` **be/src/vec/exprs/vcompound_pred.h:298:** +1 ```cpp if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false && lhs_all_is_not_null)) { ^ ``` **be/src/vec/exprs/vcompound_pred.h:298:** +1 ```cpp if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false && lhs_all_is_not_null)) { ^ ``` **be/src/vec/exprs/vcompound_pred.h:298:** +1 ```cpp if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false && lhs_all_is_not_null)) { ^ ``` **be/src/vec/exprs/vcompound_pred.h:301:** +1, nesting level increased to 3 ```cpp } else if ((rhs_all_true && !rhs_is_nullable) || ^ ``` **be/src/vec/exprs/vcompound_pred.h:301:** +1 ```cpp } else if ((rhs_all_true && !rhs_is_nullable) || ^ ``` **be/src/vec/exprs/vcompound_pred.h:301:** +1 ```cpp } else if ((rhs_all_true && !rhs_is_nullable) || ^ ``` **be/src/vec/exprs/vcompound_pred.h:302:** +1 ```cpp (rhs_all_true && rhs_all_is_not_null)) { ^ ``` **be/src/vec/exprs/vcompound_pred.h:305:** +1, nesting level increased to 3 ```cpp } else if ((rhs_all_false && !rhs_is_nullable) || ^ ``` **be/src/vec/exprs/vcompound_pred.h:305:** +1 ```cpp } else if ((rhs_all_false && !rhs_is_nullable) || ^ ``` **be/src/vec/exprs/vcompound_pred.h:305:** +1 ```cpp } else if ((rhs_all_false && !rhs_is_nullable) || ^ ``` **be/src/vec/exprs/vcompound_pred.h:306:** +1 ```cpp (rhs_all_false && rhs_all_is_not_null)) { ^ ``` **be/src/vec/exprs/vcompound_pred.h:309:** +1, nesting level increased to 3 ```cpp } else { ^ ``` **be/src/vec/exprs/vcompound_pred.h:310:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp if (!result_is_nullable) { ^ ``` **be/src/vec/exprs/vcompound_pred.h:312:** +5, including nesting penalty of 4, nesting level increased to 5 ```cpp for (size_t i = 0; i < size; i++) { ^ ``` **be/src/vec/exprs/vcompound_pred.h:315:** +1, nesting level increased to 4 ```cpp } else { ^ ``` **be/src/vec/exprs/vcompound_pred.h:320:** +1, nesting level increased to 1 ```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