github-actions[bot] commented on code in PR #38908:
URL: https://github.com/apache/doris/pull/38908#discussion_r1715497489
##########
be/src/vec/exprs/vcompound_pred.h:
##########
@@ -53,6 +54,92 @@ class VCompoundPred : public VectorizedFnCall {
const std::string& expr_name() const override { return _expr_name; }
+ Status evaluate_inverted_index(VExprContext* context,
Review Comment:
warning: function 'evaluate_inverted_index' exceeds recommended
size/complexity thresholds [readability-function-size]
```cpp
Status evaluate_inverted_index(VExprContext* context,
^
```
<details>
<summary>Additional context</summary>
**be/src/vec/exprs/vcompound_pred.h:56:** 84 lines including whitespace and
comments (threshold 80)
```cpp
Status evaluate_inverted_index(VExprContext* context,
^
```
</details>
##########
be/src/vec/exprs/vcompound_pred.h:
##########
@@ -123,6 +210,16 @@
}
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:212:** +1, including nesting penalty of
0, nesting level increased to 1
```cpp
if (context->get_inverted_index_result_column().contains(this)) {
^
```
**be/src/vec/exprs/vcompound_pred.h:222:** +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:228:** +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:626:** expanded from macro 'RETURN_IF_ERROR'
```cpp
do { \
^
```
**be/src/vec/exprs/vcompound_pred.h:228:** +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:628:** expanded from macro 'RETURN_IF_ERROR'
```cpp
if (UNLIKELY(!_status_.ok())) { \
^
```
**be/src/vec/exprs/vcompound_pred.h:240:** +1, including nesting penalty of
0, nesting level increased to 1
```cpp
if (lhs_is_nullable) {
^
```
**be/src/vec/exprs/vcompound_pred.h:254:** nesting level increased to 1
```cpp
auto get_rhs_colum = [&]() {
^
```
**be/src/vec/exprs/vcompound_pred.h:255:** +2, including nesting penalty of
1, nesting level increased to 2
```cpp
if (rhs_id == -1) {
^
```
**be/src/vec/exprs/vcompound_pred.h:256:** +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:626:** expanded from macro 'RETURN_IF_ERROR'
```cpp
do { \
^
```
**be/src/vec/exprs/vcompound_pred.h:256:** +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:628:** expanded from macro 'RETURN_IF_ERROR'
```cpp
if (UNLIKELY(!_status_.ok())) { \
^
```
**be/src/vec/exprs/vcompound_pred.h:266:** +3, including nesting penalty of
2, nesting level increased to 3
```cpp
if (rhs_is_nullable) {
^
```
**be/src/vec/exprs/vcompound_pred.h:274:** 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:275:** +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:275:** +1
```cpp
if (result_is_nullable && !res_column->is_nullable()) {
^
```
**be/src/vec/exprs/vcompound_pred.h:284:** nesting level increased to 1
```cpp
auto create_null_map_column = [&](ColumnPtr& null_map_column,
^
```
**be/src/vec/exprs/vcompound_pred.h:286:** +2, including nesting penalty of
1, nesting level increased to 2
```cpp
if (null_map_data == nullptr) {
^
```
**be/src/vec/exprs/vcompound_pred.h:295:** nesting level increased to 1
```cpp
auto vector_vector_null = [&]<bool is_and_op>() {
^
```
**be/src/vec/exprs/vcompound_pred.h:305:** +2, including nesting penalty of
1, nesting level increased to 2
```cpp
if constexpr (is_and_op) {
^
```
**be/src/vec/exprs/vcompound_pred.h:306:** +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:311:** +1, nesting level increased to 2
```cpp
} else {
^
```
**be/src/vec/exprs/vcompound_pred.h:312:** +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:325:** +1, including nesting penalty of
0, nesting level increased to 1
```cpp
if (_op == TExprOpcode::COMPOUND_AND) {
^
```
**be/src/vec/exprs/vcompound_pred.h:328:** +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:328:** +1
```cpp
if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false &&
lhs_all_is_not_null)) {
^
```
**be/src/vec/exprs/vcompound_pred.h:328:** +1
```cpp
if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false &&
lhs_all_is_not_null)) {
^
```
**be/src/vec/exprs/vcompound_pred.h:328:** +1
```cpp
if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false &&
lhs_all_is_not_null)) {
^
```
**be/src/vec/exprs/vcompound_pred.h:331:** +1, nesting level increased to 2
```cpp
} else {
^
```
**be/src/vec/exprs/vcompound_pred.h:332:** +3, including nesting penalty of
2, nesting level increased to 3
```cpp
RETURN_IF_ERROR(get_rhs_colum());
^
```
**be/src/common/status.h:626:** expanded from macro 'RETURN_IF_ERROR'
```cpp
do { \
^
```
**be/src/vec/exprs/vcompound_pred.h:332:** +4, including nesting penalty of
3, nesting level increased to 4
```cpp
RETURN_IF_ERROR(get_rhs_colum());
^
```
**be/src/common/status.h:628:** expanded from macro 'RETURN_IF_ERROR'
```cpp
if (UNLIKELY(!_status_.ok())) { \
^
```
**be/src/vec/exprs/vcompound_pred.h:334:** +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:334:** +1
```cpp
if ((lhs_all_true && !lhs_is_nullable) || //not null
column
^
```
**be/src/vec/exprs/vcompound_pred.h:334:** +1
```cpp
if ((lhs_all_true && !lhs_is_nullable) || //not null
column
^
```
**be/src/vec/exprs/vcompound_pred.h:335:** +1
```cpp
(lhs_all_true && lhs_all_is_not_null)) { //nullable
column
^
```
**be/src/vec/exprs/vcompound_pred.h:338:** +1, nesting level increased to 3
```cpp
} else if ((rhs_all_false && !rhs_is_nullable) ||
^
```
**be/src/vec/exprs/vcompound_pred.h:338:** +1
```cpp
} else if ((rhs_all_false && !rhs_is_nullable) ||
^
```
**be/src/vec/exprs/vcompound_pred.h:338:** +1
```cpp
} else if ((rhs_all_false && !rhs_is_nullable) ||
^
```
**be/src/vec/exprs/vcompound_pred.h:339:** +1
```cpp
(rhs_all_false && rhs_all_is_not_null)) {
^
```
**be/src/vec/exprs/vcompound_pred.h:342:** +1, nesting level increased to 3
```cpp
} else if ((rhs_all_true && !rhs_is_nullable) ||
^
```
**be/src/vec/exprs/vcompound_pred.h:342:** +1
```cpp
} else if ((rhs_all_true && !rhs_is_nullable) ||
^
```
**be/src/vec/exprs/vcompound_pred.h:342:** +1
```cpp
} else if ((rhs_all_true && !rhs_is_nullable) ||
^
```
**be/src/vec/exprs/vcompound_pred.h:343:** +1
```cpp
(rhs_all_true && rhs_all_is_not_null)) {
^
```
**be/src/vec/exprs/vcompound_pred.h:346:** +1, nesting level increased to 3
```cpp
} else {
^
```
**be/src/vec/exprs/vcompound_pred.h:347:** +4, including nesting penalty of
3, nesting level increased to 4
```cpp
if (!result_is_nullable) {
^
```
**be/src/vec/exprs/vcompound_pred.h:349:** +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:352:** +1, nesting level increased to 4
```cpp
} else {
^
```
**be/src/vec/exprs/vcompound_pred.h:357:** +1, nesting level increased to 1
```cpp
} else if (_op == TExprOpcode::COMPOUND_OR) {
^
```
**be/src/vec/exprs/vcompound_pred.h:360:** +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:360:** +1
```cpp
if ((lhs_all_true && !lhs_is_nullable) || (lhs_all_true &&
lhs_all_is_not_null)) {
^
```
**be/src/vec/exprs/vcompound_pred.h:360:** +1
```cpp
if ((lhs_all_true && !lhs_is_nullable) || (lhs_all_true &&
lhs_all_is_not_null)) {
^
```
**be/src/vec/exprs/vcompound_pred.h:360:** +1
```cpp
if ((lhs_all_true && !lhs_is_nullable) || (lhs_all_true &&
lhs_all_is_not_null)) {
^
```
**be/src/vec/exprs/vcompound_pred.h:363:** +1, nesting level increased to 2
```cpp
} else {
^
```
**be/src/vec/exprs/vcompound_pred.h:364:** +3, including nesting penalty of
2, nesting level increased to 3
```cpp
RETURN_IF_ERROR(get_rhs_colum());
^
```
**be/src/common/status.h:626:** expanded from macro 'RETURN_IF_ERROR'
```cpp
do { \
^
```
**be/src/vec/exprs/vcompound_pred.h:364:** +4, including nesting penalty of
3, nesting level increased to 4
```cpp
RETURN_IF_ERROR(get_rhs_colum());
^
```
**be/src/common/status.h:628:** expanded from macro 'RETURN_IF_ERROR'
```cpp
if (UNLIKELY(!_status_.ok())) { \
^
```
**be/src/vec/exprs/vcompound_pred.h:365:** +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:365:** +1
```cpp
if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false &&
lhs_all_is_not_null)) {
^
```
**be/src/vec/exprs/vcompound_pred.h:365:** +1
```cpp
if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false &&
lhs_all_is_not_null)) {
^
```
**be/src/vec/exprs/vcompound_pred.h:365:** +1
```cpp
if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false &&
lhs_all_is_not_null)) {
^
```
**be/src/vec/exprs/vcompound_pred.h:368:** +1, nesting level increased to 3
```cpp
} else if ((rhs_all_true && !rhs_is_nullable) ||
^
```
**be/src/vec/exprs/vcompound_pred.h:368:** +1
```cpp
} else if ((rhs_all_true && !rhs_is_nullable) ||
^
```
**be/src/vec/exprs/vcompound_pred.h:368:** +1
```cpp
} else if ((rhs_all_true && !rhs_is_nullable) ||
^
```
**be/src/vec/exprs/vcompound_pred.h:369:** +1
```cpp
(rhs_all_true && rhs_all_is_not_null)) {
^
```
**be/src/vec/exprs/vcompound_pred.h:372:** +1, nesting level increased to 3
```cpp
} else if ((rhs_all_false && !rhs_is_nullable) ||
^
```
**be/src/vec/exprs/vcompound_pred.h:372:** +1
```cpp
} else if ((rhs_all_false && !rhs_is_nullable) ||
^
```
**be/src/vec/exprs/vcompound_pred.h:372:** +1
```cpp
} else if ((rhs_all_false && !rhs_is_nullable) ||
^
```
**be/src/vec/exprs/vcompound_pred.h:373:** +1
```cpp
(rhs_all_false && rhs_all_is_not_null)) {
^
```
**be/src/vec/exprs/vcompound_pred.h:376:** +1, nesting level increased to 3
```cpp
} else {
^
```
**be/src/vec/exprs/vcompound_pred.h:377:** +4, including nesting penalty of
3, nesting level increased to 4
```cpp
if (!result_is_nullable) {
^
```
**be/src/vec/exprs/vcompound_pred.h:379:** +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:382:** +1, nesting level increased to 4
```cpp
} else {
^
```
**be/src/vec/exprs/vcompound_pred.h:387:** +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: [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]