Skip to content

Conversation

@zzzxl1993
Copy link
Contributor

@zzzxl1993 zzzxl1993 commented Jul 21, 2024

Proposed changes

#36565
#37842
#37921
#37386

## Proposed changes

1. NULL_LITERAL and other LITERAL will enter the else process
incorrectly
2. SELECT * FROM table_name WHERE column_name NOT IN (1, 2, NULL); The
NOT IN operator returns an empty result set when the collection contains
NULL.
## Proposed changes

1. Index does not handle NULL literal for now
@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR

Since 2024-03-18, the Document has been moved to doris-website.
See Doris Document.

@zzzxl1993
Copy link
Contributor Author

run buildall

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

template <typename Derived>
template <PrimitiveType T>
Status ScanLocalState<Derived>::_normalize_binary_in_compound_predicate(
Status ScanLocalState<Derived>::_normalize_binary_compound_predicate(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function '_normalize_binary_compound_predicate' has cognitive complexity of 54 (threshold 50) [readability-function-cognitive-complexity]

Status ScanLocalState<Derived>::_normalize_binary_compound_predicate(
                                ^
Additional context

be/src/pipeline/exec/scan_operator.cpp:1084: +1, including nesting penalty of 0, nesting level increased to 1

    if (TExprNodeType::BINARY_PRED == expr->node_type()) {
    ^

be/src/pipeline/exec/scan_operator.cpp:1085: nesting level increased to 2

        auto eq_checker = [](const std::string& fn_name) { return fn_name == "eq"; };
                          ^

be/src/pipeline/exec/scan_operator.cpp:1086: nesting level increased to 2

        auto ne_checker = [](const std::string& fn_name) { return fn_name == "ne"; };
                          ^

be/src/pipeline/exec/scan_operator.cpp:1087: nesting level increased to 2

        auto noneq_checker = [](const std::string& fn_name) {
                             ^

be/src/pipeline/exec/scan_operator.cpp:1088: +1

            return fn_name != "ne" && fn_name != "eq" && fn_name != "eq_for_null";
                                                      ^

be/src/pipeline/exec/scan_operator.cpp:1096: +2, including nesting penalty of 1, nesting level increased to 2

        RETURN_IF_ERROR(_should_push_down_binary_predicate(
        ^

be/src/common/status.h:609: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/pipeline/exec/scan_operator.cpp:1096: +3, including nesting penalty of 2, nesting level increased to 3

        RETURN_IF_ERROR(_should_push_down_binary_predicate(
        ^

be/src/common/status.h:611: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/pipeline/exec/scan_operator.cpp:1099: +2, including nesting penalty of 1, nesting level increased to 2

        RETURN_IF_ERROR(_should_push_down_binary_predicate(
        ^

be/src/common/status.h:609: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/pipeline/exec/scan_operator.cpp:1099: +3, including nesting penalty of 2, nesting level increased to 3

        RETURN_IF_ERROR(_should_push_down_binary_predicate(
        ^

be/src/common/status.h:611: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/pipeline/exec/scan_operator.cpp:1102: +2, including nesting penalty of 1, nesting level increased to 2

        RETURN_IF_ERROR(_should_push_down_binary_predicate(
        ^

be/src/common/status.h:609: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/pipeline/exec/scan_operator.cpp:1102: +3, including nesting penalty of 2, nesting level increased to 3

        RETURN_IF_ERROR(_should_push_down_binary_predicate(
        ^

be/src/common/status.h:611: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/pipeline/exec/scan_operator.cpp:1105: +2, including nesting penalty of 1, nesting level increased to 2

        if (eq_pdt == vectorized::VScanNode::PushDownType::UNACCEPTABLE &&
        ^

be/src/pipeline/exec/scan_operator.cpp:1106: +1

            ne_pdt == vectorized::VScanNode::PushDownType::UNACCEPTABLE &&
                                                                        ^

be/src/pipeline/exec/scan_operator.cpp:1113: +2, including nesting penalty of 1, nesting level increased to 2

        if (eq_pdt == vectorized::VScanNode::PushDownType::ACCEPTABLE ||
        ^

be/src/pipeline/exec/scan_operator.cpp:1114: +1

            ne_pdt == vectorized::VScanNode::PushDownType::ACCEPTABLE ||
                                                                      ^

be/src/pipeline/exec/scan_operator.cpp:1116: +3, including nesting penalty of 2, nesting level increased to 3

            if (value.data != nullptr) {
            ^

be/src/pipeline/exec/scan_operator.cpp:1117: +4, including nesting penalty of 3, nesting level increased to 4

                if constexpr (T == TYPE_CHAR || T == TYPE_VARCHAR || T == TYPE_STRING ||
                ^

be/src/pipeline/exec/scan_operator.cpp:1117: +1

                if constexpr (T == TYPE_CHAR || T == TYPE_VARCHAR || T == TYPE_STRING ||
                                                                                      ^

be/src/pipeline/exec/scan_operator.cpp:1120: +5, including nesting penalty of 4, nesting level increased to 5

                    RETURN_IF_ERROR(_change_value_range<false>(
                    ^

be/src/common/status.h:609: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/pipeline/exec/scan_operator.cpp:1120: +6, including nesting penalty of 5, nesting level increased to 6

                    RETURN_IF_ERROR(_change_value_range<false>(
                    ^

be/src/common/status.h:611: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/pipeline/exec/scan_operator.cpp:1124: +1, nesting level increased to 4

                } else {
                  ^

be/src/pipeline/exec/scan_operator.cpp:1125: +5, including nesting penalty of 4, nesting level increased to 5

                    RETURN_IF_ERROR(_change_value_range<false>(
                    ^

be/src/common/status.h:609: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/pipeline/exec/scan_operator.cpp:1125: +6, including nesting penalty of 5, nesting level increased to 6

                    RETURN_IF_ERROR(_change_value_range<false>(
                    ^

be/src/common/status.h:611: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

@zzzxl1993
Copy link
Contributor Author

run buildall

@zzzxl1993 zzzxl1993 force-pushed the branch-2.1.inlist branch from f1631b9 to 61d8fc5 Compare July 23, 2024 14:13
@zzzxl1993
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 36.44% (9236/25344)
Line Coverage: 27.98% (75511/269887)
Region Coverage: 26.79% (38819/144888)
Branch Coverage: 23.54% (19714/83754)
Coverage Report: http://coverage.selectdb-in.cc/coverage/61d8fc51dc05959267ec3aa0339d2fd8d7582213_61d8fc51dc05959267ec3aa0339d2fd8d7582213/report/index.html

…he#37386)

1. this case is effective only when enable_common_expr_pushdown = true.
@zzzxl1993 zzzxl1993 force-pushed the branch-2.1.inlist branch from 61d8fc5 to 44a78de Compare July 24, 2024 09:41
@zzzxl1993
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 36.45% (9238/25344)
Line Coverage: 27.98% (75522/269890)
Region Coverage: 26.79% (38824/144894)
Branch Coverage: 23.53% (19709/83760)
Coverage Report: http://coverage.selectdb-in.cc/coverage/44a78de2e3cd844d603b60999c69c07918997fd8_44a78de2e3cd844d603b60999c69c07918997fd8/report/index.html

@yiguolei yiguolei merged commit e2bb86e into apache:branch-2.1 Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants