-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Refactor](inverted index) refactor inverted index compound predicates evaluate logic #38908
Conversation
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
There was a problem hiding this 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
@@ -123,6 +204,18 @@ class VCompoundPred : public VectorizedFnCall { | |||
} | |||
|
|||
Status execute(VExprContext* context, Block* block, int* result_column_id) override { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: function 'execute' has cognitive complexity of 113 (threshold 50) [readability-function-cognitive-complexity]
Status execute(VExprContext* context, Block* block, int* result_column_id) override {
^
Additional context
be/src/vec/exprs/vcompound_pred.h:206: +1, including nesting penalty of 0, nesting level increased to 1
if (context->get_inverted_index_result_column().contains(this)) {
^
be/src/vec/exprs/vcompound_pred.h:210: +2, including nesting penalty of 1, nesting level increased to 2
for (int i = 0; i < result_column->size(); i++) {
^
be/src/vec/exprs/vcompound_pred.h:218: +1, including nesting penalty of 0, nesting level increased to 1
if (children().size() == 1 || !_all_child_is_compound_and_not_const()) {
^
be/src/vec/exprs/vcompound_pred.h:224: +1, including nesting penalty of 0, nesting level increased to 1
RETURN_IF_ERROR(_children[0]->execute(context, block, &lhs_id));
^
be/src/common/status.h:618: expanded from macro 'RETURN_IF_ERROR'
do { \
^
be/src/vec/exprs/vcompound_pred.h:224: +2, including nesting penalty of 1, nesting level increased to 2
RETURN_IF_ERROR(_children[0]->execute(context, block, &lhs_id));
^
be/src/common/status.h:620: expanded from macro 'RETURN_IF_ERROR'
if (UNLIKELY(!_status_.ok())) { \
^
be/src/vec/exprs/vcompound_pred.h:236: +1, including nesting penalty of 0, nesting level increased to 1
if (lhs_is_nullable) {
^
be/src/vec/exprs/vcompound_pred.h:250: nesting level increased to 1
auto get_rhs_colum = [&]() {
^
be/src/vec/exprs/vcompound_pred.h:251: +2, including nesting penalty of 1, nesting level increased to 2
if (rhs_id == -1) {
^
be/src/vec/exprs/vcompound_pred.h:252: +3, including nesting penalty of 2, nesting level increased to 3
RETURN_IF_ERROR(_children[1]->execute(context, block, &rhs_id));
^
be/src/common/status.h:618: expanded from macro 'RETURN_IF_ERROR'
do { \
^
be/src/vec/exprs/vcompound_pred.h:252: +4, including nesting penalty of 3, nesting level increased to 4
RETURN_IF_ERROR(_children[1]->execute(context, block, &rhs_id));
^
be/src/common/status.h:620: expanded from macro 'RETURN_IF_ERROR'
if (UNLIKELY(!_status_.ok())) { \
^
be/src/vec/exprs/vcompound_pred.h:262: +3, including nesting penalty of 2, nesting level increased to 3
if (rhs_is_nullable) {
^
be/src/vec/exprs/vcompound_pred.h:270: nesting level increased to 1
auto return_result_column_id = [&](ColumnPtr res_column, int res_id) -> int {
^
be/src/vec/exprs/vcompound_pred.h:271: +2, including nesting penalty of 1, nesting level increased to 2
if (result_is_nullable && !res_column->is_nullable()) {
^
be/src/vec/exprs/vcompound_pred.h:271: +1
if (result_is_nullable && !res_column->is_nullable()) {
^
be/src/vec/exprs/vcompound_pred.h:280: nesting level increased to 1
auto create_null_map_column = [&](ColumnPtr& null_map_column,
^
be/src/vec/exprs/vcompound_pred.h:282: +2, including nesting penalty of 1, nesting level increased to 2
if (null_map_data == nullptr) {
^
be/src/vec/exprs/vcompound_pred.h:291: nesting level increased to 1
auto vector_vector_null = [&]<bool is_and_op>() {
^
be/src/vec/exprs/vcompound_pred.h:301: +2, including nesting penalty of 1, nesting level increased to 2
if constexpr (is_and_op) {
^
be/src/vec/exprs/vcompound_pred.h:302: +3, including nesting penalty of 2, nesting level increased to 3
for (size_t i = 0; i < size; ++i) {
^
be/src/vec/exprs/vcompound_pred.h:307: +1, nesting level increased to 2
} else {
^
be/src/vec/exprs/vcompound_pred.h:308: +3, including nesting penalty of 2, nesting level increased to 3
for (size_t i = 0; i < size; ++i) {
^
be/src/vec/exprs/vcompound_pred.h:321: +1, including nesting penalty of 0, nesting level increased to 1
if (_op == TExprOpcode::COMPOUND_AND) {
^
be/src/vec/exprs/vcompound_pred.h:324: +2, including nesting penalty of 1, nesting level increased to 2
if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:324: +1
if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:324: +1
if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:324: +1
if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:327: +1, nesting level increased to 2
} else {
^
be/src/vec/exprs/vcompound_pred.h:328: +3, including nesting penalty of 2, nesting level increased to 3
RETURN_IF_ERROR(get_rhs_colum());
^
be/src/common/status.h:618: expanded from macro 'RETURN_IF_ERROR'
do { \
^
be/src/vec/exprs/vcompound_pred.h:328: +4, including nesting penalty of 3, nesting level increased to 4
RETURN_IF_ERROR(get_rhs_colum());
^
be/src/common/status.h:620: expanded from macro 'RETURN_IF_ERROR'
if (UNLIKELY(!_status_.ok())) { \
^
be/src/vec/exprs/vcompound_pred.h:330: +3, including nesting penalty of 2, nesting level increased to 3
if ((lhs_all_true && !lhs_is_nullable) || //not null column
^
be/src/vec/exprs/vcompound_pred.h:330: +1
if ((lhs_all_true && !lhs_is_nullable) || //not null column
^
be/src/vec/exprs/vcompound_pred.h:330: +1
if ((lhs_all_true && !lhs_is_nullable) || //not null column
^
be/src/vec/exprs/vcompound_pred.h:331: +1
(lhs_all_true && lhs_all_is_not_null)) { //nullable column
^
be/src/vec/exprs/vcompound_pred.h:334: +1, nesting level increased to 3
} else if ((rhs_all_false && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:334: +1
} else if ((rhs_all_false && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:334: +1
} else if ((rhs_all_false && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:335: +1
(rhs_all_false && rhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:338: +1, nesting level increased to 3
} else if ((rhs_all_true && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:338: +1
} else if ((rhs_all_true && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:338: +1
} else if ((rhs_all_true && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:339: +1
(rhs_all_true && rhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:342: +1, nesting level increased to 3
} else {
^
be/src/vec/exprs/vcompound_pred.h:343: +4, including nesting penalty of 3, nesting level increased to 4
if (!result_is_nullable) {
^
be/src/vec/exprs/vcompound_pred.h:345: +5, including nesting penalty of 4, nesting level increased to 5
for (size_t i = 0; i < size; i++) {
^
be/src/vec/exprs/vcompound_pred.h:348: +1, nesting level increased to 4
} else {
^
be/src/vec/exprs/vcompound_pred.h:353: +1, nesting level increased to 1
} else if (_op == TExprOpcode::COMPOUND_OR) {
^
be/src/vec/exprs/vcompound_pred.h:356: +2, including nesting penalty of 1, nesting level increased to 2
if ((lhs_all_true && !lhs_is_nullable) || (lhs_all_true && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:356: +1
if ((lhs_all_true && !lhs_is_nullable) || (lhs_all_true && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:356: +1
if ((lhs_all_true && !lhs_is_nullable) || (lhs_all_true && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:356: +1
if ((lhs_all_true && !lhs_is_nullable) || (lhs_all_true && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:359: +1, nesting level increased to 2
} else {
^
be/src/vec/exprs/vcompound_pred.h:360: +3, including nesting penalty of 2, nesting level increased to 3
RETURN_IF_ERROR(get_rhs_colum());
^
be/src/common/status.h:618: expanded from macro 'RETURN_IF_ERROR'
do { \
^
be/src/vec/exprs/vcompound_pred.h:360: +4, including nesting penalty of 3, nesting level increased to 4
RETURN_IF_ERROR(get_rhs_colum());
^
be/src/common/status.h:620: expanded from macro 'RETURN_IF_ERROR'
if (UNLIKELY(!_status_.ok())) { \
^
be/src/vec/exprs/vcompound_pred.h:361: +3, including nesting penalty of 2, nesting level increased to 3
if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:361: +1
if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:361: +1
if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:361: +1
if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:364: +1, nesting level increased to 3
} else if ((rhs_all_true && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:364: +1
} else if ((rhs_all_true && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:364: +1
} else if ((rhs_all_true && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:365: +1
(rhs_all_true && rhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:368: +1, nesting level increased to 3
} else if ((rhs_all_false && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:368: +1
} else if ((rhs_all_false && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:368: +1
} else if ((rhs_all_false && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:369: +1
(rhs_all_false && rhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:372: +1, nesting level increased to 3
} else {
^
be/src/vec/exprs/vcompound_pred.h:373: +4, including nesting penalty of 3, nesting level increased to 4
if (!result_is_nullable) {
^
be/src/vec/exprs/vcompound_pred.h:375: +5, including nesting penalty of 4, nesting level increased to 5
for (size_t i = 0; i < size; i++) {
^
be/src/vec/exprs/vcompound_pred.h:378: +1, nesting level increased to 4
} else {
^
be/src/vec/exprs/vcompound_pred.h:383: +1, nesting level increased to 1
} else {
^
There was a problem hiding this 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
@@ -123,6 +191,18 @@ class VCompoundPred : public VectorizedFnCall { | |||
} | |||
|
|||
Status execute(VExprContext* context, Block* block, int* result_column_id) override { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: function 'execute' has cognitive complexity of 113 (threshold 50) [readability-function-cognitive-complexity]
Status execute(VExprContext* context, Block* block, int* result_column_id) override {
^
Additional context
be/src/vec/exprs/vcompound_pred.h:193: +1, including nesting penalty of 0, nesting level increased to 1
if (context->get_inverted_index_result_column().contains(this)) {
^
be/src/vec/exprs/vcompound_pred.h:197: +2, including nesting penalty of 1, nesting level increased to 2
for (int i = 0; i < result_column->size(); i++) {
^
be/src/vec/exprs/vcompound_pred.h:205: +1, including nesting penalty of 0, nesting level increased to 1
if (children().size() == 1 || !_all_child_is_compound_and_not_const()) {
^
be/src/vec/exprs/vcompound_pred.h:211: +1, including nesting penalty of 0, nesting level increased to 1
RETURN_IF_ERROR(_children[0]->execute(context, block, &lhs_id));
^
be/src/common/status.h:618: expanded from macro 'RETURN_IF_ERROR'
do { \
^
be/src/vec/exprs/vcompound_pred.h:211: +2, including nesting penalty of 1, nesting level increased to 2
RETURN_IF_ERROR(_children[0]->execute(context, block, &lhs_id));
^
be/src/common/status.h:620: expanded from macro 'RETURN_IF_ERROR'
if (UNLIKELY(!_status_.ok())) { \
^
be/src/vec/exprs/vcompound_pred.h:223: +1, including nesting penalty of 0, nesting level increased to 1
if (lhs_is_nullable) {
^
be/src/vec/exprs/vcompound_pred.h:237: nesting level increased to 1
auto get_rhs_colum = [&]() {
^
be/src/vec/exprs/vcompound_pred.h:238: +2, including nesting penalty of 1, nesting level increased to 2
if (rhs_id == -1) {
^
be/src/vec/exprs/vcompound_pred.h:239: +3, including nesting penalty of 2, nesting level increased to 3
RETURN_IF_ERROR(_children[1]->execute(context, block, &rhs_id));
^
be/src/common/status.h:618: expanded from macro 'RETURN_IF_ERROR'
do { \
^
be/src/vec/exprs/vcompound_pred.h:239: +4, including nesting penalty of 3, nesting level increased to 4
RETURN_IF_ERROR(_children[1]->execute(context, block, &rhs_id));
^
be/src/common/status.h:620: expanded from macro 'RETURN_IF_ERROR'
if (UNLIKELY(!_status_.ok())) { \
^
be/src/vec/exprs/vcompound_pred.h:249: +3, including nesting penalty of 2, nesting level increased to 3
if (rhs_is_nullable) {
^
be/src/vec/exprs/vcompound_pred.h:257: nesting level increased to 1
auto return_result_column_id = [&](ColumnPtr res_column, int res_id) -> int {
^
be/src/vec/exprs/vcompound_pred.h:258: +2, including nesting penalty of 1, nesting level increased to 2
if (result_is_nullable && !res_column->is_nullable()) {
^
be/src/vec/exprs/vcompound_pred.h:258: +1
if (result_is_nullable && !res_column->is_nullable()) {
^
be/src/vec/exprs/vcompound_pred.h:267: nesting level increased to 1
auto create_null_map_column = [&](ColumnPtr& null_map_column,
^
be/src/vec/exprs/vcompound_pred.h:269: +2, including nesting penalty of 1, nesting level increased to 2
if (null_map_data == nullptr) {
^
be/src/vec/exprs/vcompound_pred.h:278: nesting level increased to 1
auto vector_vector_null = [&]<bool is_and_op>() {
^
be/src/vec/exprs/vcompound_pred.h:288: +2, including nesting penalty of 1, nesting level increased to 2
if constexpr (is_and_op) {
^
be/src/vec/exprs/vcompound_pred.h:289: +3, including nesting penalty of 2, nesting level increased to 3
for (size_t i = 0; i < size; ++i) {
^
be/src/vec/exprs/vcompound_pred.h:294: +1, nesting level increased to 2
} else {
^
be/src/vec/exprs/vcompound_pred.h:295: +3, including nesting penalty of 2, nesting level increased to 3
for (size_t i = 0; i < size; ++i) {
^
be/src/vec/exprs/vcompound_pred.h:308: +1, including nesting penalty of 0, nesting level increased to 1
if (_op == TExprOpcode::COMPOUND_AND) {
^
be/src/vec/exprs/vcompound_pred.h:311: +2, including nesting penalty of 1, nesting level increased to 2
if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:311: +1
if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:311: +1
if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:311: +1
if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:314: +1, nesting level increased to 2
} else {
^
be/src/vec/exprs/vcompound_pred.h:315: +3, including nesting penalty of 2, nesting level increased to 3
RETURN_IF_ERROR(get_rhs_colum());
^
be/src/common/status.h:618: expanded from macro 'RETURN_IF_ERROR'
do { \
^
be/src/vec/exprs/vcompound_pred.h:315: +4, including nesting penalty of 3, nesting level increased to 4
RETURN_IF_ERROR(get_rhs_colum());
^
be/src/common/status.h:620: expanded from macro 'RETURN_IF_ERROR'
if (UNLIKELY(!_status_.ok())) { \
^
be/src/vec/exprs/vcompound_pred.h:317: +3, including nesting penalty of 2, nesting level increased to 3
if ((lhs_all_true && !lhs_is_nullable) || //not null column
^
be/src/vec/exprs/vcompound_pred.h:317: +1
if ((lhs_all_true && !lhs_is_nullable) || //not null column
^
be/src/vec/exprs/vcompound_pred.h:317: +1
if ((lhs_all_true && !lhs_is_nullable) || //not null column
^
be/src/vec/exprs/vcompound_pred.h:318: +1
(lhs_all_true && lhs_all_is_not_null)) { //nullable column
^
be/src/vec/exprs/vcompound_pred.h:321: +1, nesting level increased to 3
} else if ((rhs_all_false && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:321: +1
} else if ((rhs_all_false && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:321: +1
} else if ((rhs_all_false && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:322: +1
(rhs_all_false && rhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:325: +1, nesting level increased to 3
} else if ((rhs_all_true && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:325: +1
} else if ((rhs_all_true && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:325: +1
} else if ((rhs_all_true && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:326: +1
(rhs_all_true && rhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:329: +1, nesting level increased to 3
} else {
^
be/src/vec/exprs/vcompound_pred.h:330: +4, including nesting penalty of 3, nesting level increased to 4
if (!result_is_nullable) {
^
be/src/vec/exprs/vcompound_pred.h:332: +5, including nesting penalty of 4, nesting level increased to 5
for (size_t i = 0; i < size; i++) {
^
be/src/vec/exprs/vcompound_pred.h:335: +1, nesting level increased to 4
} else {
^
be/src/vec/exprs/vcompound_pred.h:340: +1, nesting level increased to 1
} else if (_op == TExprOpcode::COMPOUND_OR) {
^
be/src/vec/exprs/vcompound_pred.h:343: +2, including nesting penalty of 1, nesting level increased to 2
if ((lhs_all_true && !lhs_is_nullable) || (lhs_all_true && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:343: +1
if ((lhs_all_true && !lhs_is_nullable) || (lhs_all_true && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:343: +1
if ((lhs_all_true && !lhs_is_nullable) || (lhs_all_true && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:343: +1
if ((lhs_all_true && !lhs_is_nullable) || (lhs_all_true && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:346: +1, nesting level increased to 2
} else {
^
be/src/vec/exprs/vcompound_pred.h:347: +3, including nesting penalty of 2, nesting level increased to 3
RETURN_IF_ERROR(get_rhs_colum());
^
be/src/common/status.h:618: expanded from macro 'RETURN_IF_ERROR'
do { \
^
be/src/vec/exprs/vcompound_pred.h:347: +4, including nesting penalty of 3, nesting level increased to 4
RETURN_IF_ERROR(get_rhs_colum());
^
be/src/common/status.h:620: expanded from macro 'RETURN_IF_ERROR'
if (UNLIKELY(!_status_.ok())) { \
^
be/src/vec/exprs/vcompound_pred.h:348: +3, including nesting penalty of 2, nesting level increased to 3
if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:348: +1
if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:348: +1
if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:348: +1
if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:351: +1, nesting level increased to 3
} else if ((rhs_all_true && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:351: +1
} else if ((rhs_all_true && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:351: +1
} else if ((rhs_all_true && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:352: +1
(rhs_all_true && rhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:355: +1, nesting level increased to 3
} else if ((rhs_all_false && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:355: +1
} else if ((rhs_all_false && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:355: +1
} else if ((rhs_all_false && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:356: +1
(rhs_all_false && rhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:359: +1, nesting level increased to 3
} else {
^
be/src/vec/exprs/vcompound_pred.h:360: +4, including nesting penalty of 3, nesting level increased to 4
if (!result_is_nullable) {
^
be/src/vec/exprs/vcompound_pred.h:362: +5, including nesting penalty of 4, nesting level increased to 5
for (size_t i = 0; i < size; i++) {
^
be/src/vec/exprs/vcompound_pred.h:365: +1, nesting level increased to 4
} else {
^
be/src/vec/exprs/vcompound_pred.h:370: +1, nesting level increased to 1
} else {
^
There was a problem hiding this 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
There was a problem hiding this 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
aed7fa9
to
2f6d151
Compare
There was a problem hiding this 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
c4d7c1b
to
f186ee2
Compare
There was a problem hiding this 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
There was a problem hiding this 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
32b7de8
to
be3cd04
Compare
There was a problem hiding this 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
@@ -123,6 +210,16 @@ | |||
} | |||
|
|||
Status execute(VExprContext* context, Block* block, int* result_column_id) override { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: function 'execute' has cognitive complexity of 111 (threshold 50) [readability-function-cognitive-complexity]
Status execute(VExprContext* context, Block* block, int* result_column_id) override {
^
Additional context
be/src/vec/exprs/vcompound_pred.h:212: +1, including nesting penalty of 0, nesting level increased to 1
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
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
RETURN_IF_ERROR(_children[0]->execute(context, block, &lhs_id));
^
be/src/common/status.h:626: expanded from macro 'RETURN_IF_ERROR'
do { \
^
be/src/vec/exprs/vcompound_pred.h:228: +2, including nesting penalty of 1, nesting level increased to 2
RETURN_IF_ERROR(_children[0]->execute(context, block, &lhs_id));
^
be/src/common/status.h:628: expanded from macro 'RETURN_IF_ERROR'
if (UNLIKELY(!_status_.ok())) { \
^
be/src/vec/exprs/vcompound_pred.h:240: +1, including nesting penalty of 0, nesting level increased to 1
if (lhs_is_nullable) {
^
be/src/vec/exprs/vcompound_pred.h:254: nesting level increased to 1
auto get_rhs_colum = [&]() {
^
be/src/vec/exprs/vcompound_pred.h:255: +2, including nesting penalty of 1, nesting level increased to 2
if (rhs_id == -1) {
^
be/src/vec/exprs/vcompound_pred.h:256: +3, including nesting penalty of 2, nesting level increased to 3
RETURN_IF_ERROR(_children[1]->execute(context, block, &rhs_id));
^
be/src/common/status.h:626: expanded from macro 'RETURN_IF_ERROR'
do { \
^
be/src/vec/exprs/vcompound_pred.h:256: +4, including nesting penalty of 3, nesting level increased to 4
RETURN_IF_ERROR(_children[1]->execute(context, block, &rhs_id));
^
be/src/common/status.h:628: expanded from macro 'RETURN_IF_ERROR'
if (UNLIKELY(!_status_.ok())) { \
^
be/src/vec/exprs/vcompound_pred.h:266: +3, including nesting penalty of 2, nesting level increased to 3
if (rhs_is_nullable) {
^
be/src/vec/exprs/vcompound_pred.h:274: nesting level increased to 1
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
if (result_is_nullable && !res_column->is_nullable()) {
^
be/src/vec/exprs/vcompound_pred.h:275: +1
if (result_is_nullable && !res_column->is_nullable()) {
^
be/src/vec/exprs/vcompound_pred.h:284: nesting level increased to 1
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
if (null_map_data == nullptr) {
^
be/src/vec/exprs/vcompound_pred.h:295: nesting level increased to 1
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
if constexpr (is_and_op) {
^
be/src/vec/exprs/vcompound_pred.h:306: +3, including nesting penalty of 2, nesting level increased to 3
for (size_t i = 0; i < size; ++i) {
^
be/src/vec/exprs/vcompound_pred.h:311: +1, nesting level increased to 2
} else {
^
be/src/vec/exprs/vcompound_pred.h:312: +3, including nesting penalty of 2, nesting level increased to 3
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
if (_op == TExprOpcode::COMPOUND_AND) {
^
be/src/vec/exprs/vcompound_pred.h:328: +2, including nesting penalty of 1, nesting level increased to 2
if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:328: +1
if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:328: +1
if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:328: +1
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
} else {
^
be/src/vec/exprs/vcompound_pred.h:332: +3, including nesting penalty of 2, nesting level increased to 3
RETURN_IF_ERROR(get_rhs_colum());
^
be/src/common/status.h:626: expanded from macro 'RETURN_IF_ERROR'
do { \
^
be/src/vec/exprs/vcompound_pred.h:332: +4, including nesting penalty of 3, nesting level increased to 4
RETURN_IF_ERROR(get_rhs_colum());
^
be/src/common/status.h:628: expanded from macro 'RETURN_IF_ERROR'
if (UNLIKELY(!_status_.ok())) { \
^
be/src/vec/exprs/vcompound_pred.h:334: +3, including nesting penalty of 2, nesting level increased to 3
if ((lhs_all_true && !lhs_is_nullable) || //not null column
^
be/src/vec/exprs/vcompound_pred.h:334: +1
if ((lhs_all_true && !lhs_is_nullable) || //not null column
^
be/src/vec/exprs/vcompound_pred.h:334: +1
if ((lhs_all_true && !lhs_is_nullable) || //not null column
^
be/src/vec/exprs/vcompound_pred.h:335: +1
(lhs_all_true && lhs_all_is_not_null)) { //nullable column
^
be/src/vec/exprs/vcompound_pred.h:338: +1, nesting level increased to 3
} else if ((rhs_all_false && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:338: +1
} else if ((rhs_all_false && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:338: +1
} else if ((rhs_all_false && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:339: +1
(rhs_all_false && rhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:342: +1, nesting level increased to 3
} else if ((rhs_all_true && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:342: +1
} else if ((rhs_all_true && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:342: +1
} else if ((rhs_all_true && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:343: +1
(rhs_all_true && rhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:346: +1, nesting level increased to 3
} else {
^
be/src/vec/exprs/vcompound_pred.h:347: +4, including nesting penalty of 3, nesting level increased to 4
if (!result_is_nullable) {
^
be/src/vec/exprs/vcompound_pred.h:349: +5, including nesting penalty of 4, nesting level increased to 5
for (size_t i = 0; i < size; i++) {
^
be/src/vec/exprs/vcompound_pred.h:352: +1, nesting level increased to 4
} else {
^
be/src/vec/exprs/vcompound_pred.h:357: +1, nesting level increased to 1
} 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
if ((lhs_all_true && !lhs_is_nullable) || (lhs_all_true && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:360: +1
if ((lhs_all_true && !lhs_is_nullable) || (lhs_all_true && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:360: +1
if ((lhs_all_true && !lhs_is_nullable) || (lhs_all_true && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:360: +1
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
} else {
^
be/src/vec/exprs/vcompound_pred.h:364: +3, including nesting penalty of 2, nesting level increased to 3
RETURN_IF_ERROR(get_rhs_colum());
^
be/src/common/status.h:626: expanded from macro 'RETURN_IF_ERROR'
do { \
^
be/src/vec/exprs/vcompound_pred.h:364: +4, including nesting penalty of 3, nesting level increased to 4
RETURN_IF_ERROR(get_rhs_colum());
^
be/src/common/status.h:628: expanded from macro 'RETURN_IF_ERROR'
if (UNLIKELY(!_status_.ok())) { \
^
be/src/vec/exprs/vcompound_pred.h:365: +3, including nesting penalty of 2, nesting level increased to 3
if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:365: +1
if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:365: +1
if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:365: +1
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
} else if ((rhs_all_true && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:368: +1
} else if ((rhs_all_true && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:368: +1
} else if ((rhs_all_true && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:369: +1
(rhs_all_true && rhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:372: +1, nesting level increased to 3
} else if ((rhs_all_false && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:372: +1
} else if ((rhs_all_false && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:372: +1
} else if ((rhs_all_false && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:373: +1
(rhs_all_false && rhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:376: +1, nesting level increased to 3
} else {
^
be/src/vec/exprs/vcompound_pred.h:377: +4, including nesting penalty of 3, nesting level increased to 4
if (!result_is_nullable) {
^
be/src/vec/exprs/vcompound_pred.h:379: +5, including nesting penalty of 4, nesting level increased to 5
for (size_t i = 0; i < size; i++) {
^
be/src/vec/exprs/vcompound_pred.h:382: +1, nesting level increased to 4
} else {
^
be/src/vec/exprs/vcompound_pred.h:387: +1, nesting level increased to 1
} else {
^
run buildall |
1 similar comment
run buildall |
TPC-H: Total hot run time: 37873 ms
|
TPC-DS: Total hot run time: 183921 ms
|
ClickBench: Total hot run time: 31.23 s
|
run buildall |
df4df4c
to
e0e384b
Compare
run buildall |
TPC-H: Total hot run time: 39704 ms
|
run buildall |
There was a problem hiding this 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
} | ||
|
||
if (all_pass && !res.is_empty()) { | ||
context->set_inverted_index_result_for_expr(this, res); | ||
} | ||
return Status::OK(); | ||
} | ||
|
||
Status execute(VExprContext* context, Block* block, int* result_column_id) override { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: function 'execute' has cognitive complexity of 111 (threshold 50) [readability-function-cognitive-complexity]
Status execute(VExprContext* context, Block* block, int* result_column_id) override {
^
Additional context
be/src/vec/exprs/vcompound_pred.h:141: +1, including nesting penalty of 0, nesting level increased to 1
if (fast_execute(context, block, result_column_id)) {
^
be/src/vec/exprs/vcompound_pred.h:144: +1, including nesting penalty of 0, nesting level increased to 1
if (children().size() == 1 || !_all_child_is_compound_and_not_const()) {
^
be/src/vec/exprs/vcompound_pred.h:150: +1, including nesting penalty of 0, nesting level increased to 1
RETURN_IF_ERROR(_children[0]->execute(context, block, &lhs_id));
^
be/src/common/status.h:628: expanded from macro 'RETURN_IF_ERROR'
do { \
^
be/src/vec/exprs/vcompound_pred.h:150: +2, including nesting penalty of 1, nesting level increased to 2
RETURN_IF_ERROR(_children[0]->execute(context, block, &lhs_id));
^
be/src/common/status.h:630: expanded from macro 'RETURN_IF_ERROR'
if (UNLIKELY(!_status_.ok())) { \
^
be/src/vec/exprs/vcompound_pred.h:162: +1, including nesting penalty of 0, nesting level increased to 1
if (lhs_is_nullable) {
^
be/src/vec/exprs/vcompound_pred.h:176: nesting level increased to 1
auto get_rhs_colum = [&]() {
^
be/src/vec/exprs/vcompound_pred.h:177: +2, including nesting penalty of 1, nesting level increased to 2
if (rhs_id == -1) {
^
be/src/vec/exprs/vcompound_pred.h:178: +3, including nesting penalty of 2, nesting level increased to 3
RETURN_IF_ERROR(_children[1]->execute(context, block, &rhs_id));
^
be/src/common/status.h:628: expanded from macro 'RETURN_IF_ERROR'
do { \
^
be/src/vec/exprs/vcompound_pred.h:178: +4, including nesting penalty of 3, nesting level increased to 4
RETURN_IF_ERROR(_children[1]->execute(context, block, &rhs_id));
^
be/src/common/status.h:630: expanded from macro 'RETURN_IF_ERROR'
if (UNLIKELY(!_status_.ok())) { \
^
be/src/vec/exprs/vcompound_pred.h:188: +3, including nesting penalty of 2, nesting level increased to 3
if (rhs_is_nullable) {
^
be/src/vec/exprs/vcompound_pred.h:196: nesting level increased to 1
auto return_result_column_id = [&](ColumnPtr res_column, int res_id) -> int {
^
be/src/vec/exprs/vcompound_pred.h:197: +2, including nesting penalty of 1, nesting level increased to 2
if (result_is_nullable && !res_column->is_nullable()) {
^
be/src/vec/exprs/vcompound_pred.h:197: +1
if (result_is_nullable && !res_column->is_nullable()) {
^
be/src/vec/exprs/vcompound_pred.h:206: nesting level increased to 1
auto create_null_map_column = [&](ColumnPtr& null_map_column,
^
be/src/vec/exprs/vcompound_pred.h:208: +2, including nesting penalty of 1, nesting level increased to 2
if (null_map_data == nullptr) {
^
be/src/vec/exprs/vcompound_pred.h:217: nesting level increased to 1
auto vector_vector_null = [&]<bool is_and_op>() {
^
be/src/vec/exprs/vcompound_pred.h:227: +2, including nesting penalty of 1, nesting level increased to 2
if constexpr (is_and_op) {
^
be/src/vec/exprs/vcompound_pred.h:228: +3, including nesting penalty of 2, nesting level increased to 3
for (size_t i = 0; i < size; ++i) {
^
be/src/vec/exprs/vcompound_pred.h:233: +1, nesting level increased to 2
} else {
^
be/src/vec/exprs/vcompound_pred.h:234: +3, including nesting penalty of 2, nesting level increased to 3
for (size_t i = 0; i < size; ++i) {
^
be/src/vec/exprs/vcompound_pred.h:247: +1, including nesting penalty of 0, nesting level increased to 1
if (_op == TExprOpcode::COMPOUND_AND) {
^
be/src/vec/exprs/vcompound_pred.h:250: +2, including nesting penalty of 1, nesting level increased to 2
if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:250: +1
if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:250: +1
if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:250: +1
if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:253: +1, nesting level increased to 2
} else {
^
be/src/vec/exprs/vcompound_pred.h:254: +3, including nesting penalty of 2, nesting level increased to 3
RETURN_IF_ERROR(get_rhs_colum());
^
be/src/common/status.h:628: expanded from macro 'RETURN_IF_ERROR'
do { \
^
be/src/vec/exprs/vcompound_pred.h:254: +4, including nesting penalty of 3, nesting level increased to 4
RETURN_IF_ERROR(get_rhs_colum());
^
be/src/common/status.h:630: expanded from macro 'RETURN_IF_ERROR'
if (UNLIKELY(!_status_.ok())) { \
^
be/src/vec/exprs/vcompound_pred.h:256: +3, including nesting penalty of 2, nesting level increased to 3
if ((lhs_all_true && !lhs_is_nullable) || //not null column
^
be/src/vec/exprs/vcompound_pred.h:256: +1
if ((lhs_all_true && !lhs_is_nullable) || //not null column
^
be/src/vec/exprs/vcompound_pred.h:256: +1
if ((lhs_all_true && !lhs_is_nullable) || //not null column
^
be/src/vec/exprs/vcompound_pred.h:257: +1
(lhs_all_true && lhs_all_is_not_null)) { //nullable column
^
be/src/vec/exprs/vcompound_pred.h:260: +1, nesting level increased to 3
} else if ((rhs_all_false && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:260: +1
} else if ((rhs_all_false && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:260: +1
} else if ((rhs_all_false && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:261: +1
(rhs_all_false && rhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:264: +1, nesting level increased to 3
} else if ((rhs_all_true && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:264: +1
} else if ((rhs_all_true && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:264: +1
} else if ((rhs_all_true && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:265: +1
(rhs_all_true && rhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:268: +1, nesting level increased to 3
} else {
^
be/src/vec/exprs/vcompound_pred.h:269: +4, including nesting penalty of 3, nesting level increased to 4
if (!result_is_nullable) {
^
be/src/vec/exprs/vcompound_pred.h:271: +5, including nesting penalty of 4, nesting level increased to 5
for (size_t i = 0; i < size; i++) {
^
be/src/vec/exprs/vcompound_pred.h:274: +1, nesting level increased to 4
} else {
^
be/src/vec/exprs/vcompound_pred.h:279: +1, nesting level increased to 1
} else if (_op == TExprOpcode::COMPOUND_OR) {
^
be/src/vec/exprs/vcompound_pred.h:282: +2, including nesting penalty of 1, nesting level increased to 2
if ((lhs_all_true && !lhs_is_nullable) || (lhs_all_true && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:282: +1
if ((lhs_all_true && !lhs_is_nullable) || (lhs_all_true && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:282: +1
if ((lhs_all_true && !lhs_is_nullable) || (lhs_all_true && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:282: +1
if ((lhs_all_true && !lhs_is_nullable) || (lhs_all_true && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:285: +1, nesting level increased to 2
} else {
^
be/src/vec/exprs/vcompound_pred.h:286: +3, including nesting penalty of 2, nesting level increased to 3
RETURN_IF_ERROR(get_rhs_colum());
^
be/src/common/status.h:628: expanded from macro 'RETURN_IF_ERROR'
do { \
^
be/src/vec/exprs/vcompound_pred.h:286: +4, including nesting penalty of 3, nesting level increased to 4
RETURN_IF_ERROR(get_rhs_colum());
^
be/src/common/status.h:630: expanded from macro 'RETURN_IF_ERROR'
if (UNLIKELY(!_status_.ok())) { \
^
be/src/vec/exprs/vcompound_pred.h:287: +3, including nesting penalty of 2, nesting level increased to 3
if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:287: +1
if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:287: +1
if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:287: +1
if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false && lhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:290: +1, nesting level increased to 3
} else if ((rhs_all_true && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:290: +1
} else if ((rhs_all_true && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:290: +1
} else if ((rhs_all_true && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:291: +1
(rhs_all_true && rhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:294: +1, nesting level increased to 3
} else if ((rhs_all_false && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:294: +1
} else if ((rhs_all_false && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:294: +1
} else if ((rhs_all_false && !rhs_is_nullable) ||
^
be/src/vec/exprs/vcompound_pred.h:295: +1
(rhs_all_false && rhs_all_is_not_null)) {
^
be/src/vec/exprs/vcompound_pred.h:298: +1, nesting level increased to 3
} else {
^
be/src/vec/exprs/vcompound_pred.h:299: +4, including nesting penalty of 3, nesting level increased to 4
if (!result_is_nullable) {
^
be/src/vec/exprs/vcompound_pred.h:301: +5, including nesting penalty of 4, nesting level increased to 5
for (size_t i = 0; i < size; i++) {
^
be/src/vec/exprs/vcompound_pred.h:304: +1, nesting level increased to 4
} else {
^
be/src/vec/exprs/vcompound_pred.h:309: +1, nesting level increased to 1
} else {
^
} | ||
VLOG_DEBUG << "begin to execute match directly, column_name=" << column_name | ||
<< ", match_query_str=" << match_query_str; | ||
InvertedIndexCtx* inverted_index_ctx = reinterpret_cast<InvertedIndexCtx*>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: use auto when initializing with a cast to avoid duplicating the type name [modernize-use-auto]
InvertedIndexCtx* inverted_index_ctx = reinterpret_cast<InvertedIndexCtx*>( | |
auto* inverted_index_ctx = reinterpret_cast<InvertedIndexCtx*>( |
TPC-H: Total hot run time: 38097 ms
|
TPC-DS: Total hot run time: 184220 ms
|
ClickBench: Total hot run time: 30.64 s
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…s evaluate logic (apache#38908) This PR addresses several key issues related to the compound condition support in the inverted index, and optimization for index skipping without returning to the table: 1. **Unified Handling of `expr` and `column predicate`**: - Combined the processing of inverted index-related `column predicate` and `expr`. - Ensured that compound conditions involving both `column predicate` and `expr` are processed uniformly to reduce complexity and improve robustness. 2. **Optimized the Execution of Compound Conditions**: - Removed the logic in `scan_operator` that normalized compound predicates by pushing down logic to `_common_expr_ctxs_push_down` where `expr` contexts are managed. - Added `evaluate_inverted_index` support to the `vexpr` and function layers, such as `function comparison` and `function collection_in`. - Introduced new data structures in `VExprContext` to store results from `evaluate_inverted_index`, thus facilitating quick lookup and application of these results during execution.
…factor (apache#40324) ## Proposed changes Make profile metrics right after apache#38908
…nd (apache#40338) Untokenized strings exceed ignore_above, they are written as null, causing range query errors. Introduced by apache#38908
…_expr_pushdown is disabled (#40689) If common_expr_pushdown is disabled, we cannot guarantee that all conditions are processed by the inverted index after refactor of #38908 Consider a scenario where there is a column predicate and an expression involving the same column in the SQL query, such as 'a < 0' and 'abs(a) > 1'. This could potentially lead to errors.
…_expr_pushdown is disabled (apache#40689) If common_expr_pushdown is disabled, we cannot guarantee that all conditions are processed by the inverted index after refactor of apache#38908 Consider a scenario where there is a column predicate and an expression involving the same column in the SQL query, such as 'a < 0' and 'abs(a) > 1'. This could potentially lead to errors.
…_expr_pushdown is disabled (apache#40689) If common_expr_pushdown is disabled, we cannot guarantee that all conditions are processed by the inverted index after refactor of apache#38908 Consider a scenario where there is a column predicate and an expression involving the same column in the SQL query, such as 'a < 0' and 'abs(a) > 1'. This could potentially lead to errors.
…s evaluate logic (apache#38908) This PR addresses several key issues related to the compound condition support in the inverted index, and optimization for index skipping without returning to the table: 1. **Unified Handling of `expr` and `column predicate`**: - Combined the processing of inverted index-related `column predicate` and `expr`. - Ensured that compound conditions involving both `column predicate` and `expr` are processed uniformly to reduce complexity and improve robustness. 2. **Optimized the Execution of Compound Conditions**: - Removed the logic in `scan_operator` that normalized compound predicates by pushing down logic to `_common_expr_ctxs_push_down` where `expr` contexts are managed. - Added `evaluate_inverted_index` support to the `vexpr` and function layers, such as `function comparison` and `function collection_in`. - Introduced new data structures in `VExprContext` to store results from `evaluate_inverted_index`, thus facilitating quick lookup and application of these results during execution.
…factor (apache#40324) ## Proposed changes Make profile metrics right after apache#38908
…nd (apache#40338) Untokenized strings exceed ignore_above, they are written as null, causing range query errors. Introduced by apache#38908
…nd (apache#40338) Untokenized strings exceed ignore_above, they are written as null, causing range query errors. Introduced by apache#38908
…_expr_pushdown is disabled (apache#40689) If common_expr_pushdown is disabled, we cannot guarantee that all conditions are processed by the inverted index after refactor of apache#38908 Consider a scenario where there is a column predicate and an expression involving the same column in the SQL query, such as 'a < 0' and 'abs(a) > 1'. This could potentially lead to errors.
Proposed changes
This PR addresses several key issues related to the compound condition support in the inverted index, and optimization for index skipping without returning to the table:
Unified Handling of
expr
andcolumn predicate
:column predicate
andexpr
.column predicate
andexpr
are processed uniformly to reduce complexity and improve robustness.Optimized the Execution of Compound Conditions:
scan_operator
that normalized compound predicates by pushing down logic to_common_expr_ctxs_push_down
whereexpr
contexts are managed.evaluate_inverted_index
support to thevexpr
and function layers, such asfunction comparison
andfunction collection_in
.VExprContext
to store results fromevaluate_inverted_index
, thus facilitating quick lookup and application of these results during execution.