-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Improve](expr)first support array_contains for expr push down inverted index #32620
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
[Improve](expr)first support array_contains for expr push down inverted index #32620
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
| return true; | ||
| } | ||
|
|
||
| bool SegmentIterator::_check_apply_by_inverted_index(ColumnId col_id) { |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
be/src/vec/exprs/vcompound_pred.h
Outdated
|
|
||
| const std::string& expr_name() const override { return _expr_name; } | ||
|
|
||
| bool is_all_ones(const roaring::Roaring& r) { |
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: method 'is_all_ones' can be made static [readability-convert-member-functions-to-static]
| bool is_all_ones(const roaring::Roaring& r) { | |
| static bool is_all_ones(const roaring::Roaring& r) { |
| // 2. when meet 'and' conjunct, function with column b can not apply inverted index | ||
| // eg. a and hash(b)=1, if b can apply index, but hash(b)=1 is not for index, so b should not be extracted | ||
| // but a and array_contains(b, 1), b can be applied inverted index, which b can be extracted | ||
| Status eval_inverted_index( |
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: method 'eval_inverted_index' can be made static [readability-convert-member-functions-to-static]
| Status eval_inverted_index( | |
| static Status eval_inverted_index( |
be/src/vec/exprs/vcompound_pred.h:74:
- uint32_t num_rows, roaring::Roaring* bitmap) const override {
+ uint32_t num_rows, roaring::Roaring* bitmap) override {| std::vector<size_t>& args) override; | ||
| Status eval_inverted_index( | ||
| VExprContext* context, | ||
| const std::unordered_map<ColumnId, std::pair<vectorized::NameAndTypePair, |
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: parameter 2 is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
| const std::unordered_map<ColumnId, std::pair<vectorized::NameAndTypePair, | |
| std::unordered_map<ColumnId, std::pair<vectorized::NameAndTypePair, |
| * @return status not ok means execute failed. | ||
| */ | ||
| [[nodiscard]] Status eval_inverted_indexs( | ||
| const std::unordered_map<ColumnId, std::pair<vectorized::NameAndTypePair, |
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: parameter 1 is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
| const std::unordered_map<ColumnId, std::pair<vectorized::NameAndTypePair, | |
| std::unordered_map<ColumnId, std::pair<vectorized::NameAndTypePair, |
| return Status::OK(); | ||
| } | ||
|
|
||
| Status eval_inverted_index(FunctionContext* context, |
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: method 'eval_inverted_index' can be made static [readability-convert-member-functions-to-static]
| Status eval_inverted_index(FunctionContext* context, | |
| static Status eval_inverted_index(FunctionContext* context, |
be/src/vec/functions/function.h:411:
- roaring::Roaring* bitmap) const override {
+ roaring::Roaring* bitmap) 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.
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
| // 2. when meet 'and' conjunct, function with column b can not apply inverted index | ||
| // eg. a and hash(b)=1, if b can apply index, but hash(b)=1 is not for index, so b should not be extracted | ||
| // but a and array_contains(b, 1), b can be applied inverted index, which b can be extracted | ||
| Status eval_inverted_index( |
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: method 'eval_inverted_index' can be made static [readability-convert-member-functions-to-static]
| Status eval_inverted_index( | |
| static Status eval_inverted_index( |
be/src/vec/exprs/vcompound_pred.h:64:
- uint32_t num_rows, roaring::Roaring* bitmap) const override {
+ uint32_t num_rows, roaring::Roaring* bitmap) override {| // specific language governing permissions and limitations | ||
| // under the License. | ||
|
|
||
| #include <gtest/gtest-message.h> |
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: 'gtest/gtest-message.h' file not found [clang-diagnostic-error]
#include <gtest/gtest-message.h>
^| return create_query_value<TYPE_STRING>(value, result_param); | ||
| case PrimitiveType::TYPE_IPV4: | ||
| return create_query_value<TYPE_IPV4>(value, result_param); | ||
| case PrimitiveType::TYPE_IPV6: |
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.
we do not support HLL/IPV6/IPV4 type for inverted index
| std::unordered_map<ColumnId, std::pair<vectorized::NameAndTypePair, InvertedIndexIterator*>> | ||
| iter_map; | ||
|
|
||
| for (auto col_id : _common_expr_columns) { |
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.
how about those non-array expr be processed in this situation?
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.
just will return NotSupport
|
run buildall |
|
run buildall |
1 similar comment
|
run buildall |
|
run buildall |
|
TeamCity be ut coverage result: |
TPC-H: Total hot run time: 37236 ms |
eldenmoon
left a comment
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
|
PR approved by at least one committer and no changes requested. |
|
run buildall |
eldenmoon
left a comment
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
|
PR approved by at least one committer and no changes requested. |
TPC-DS: Total hot run time: 186909 ms |
|
TeamCity be ut coverage result: |
|
run p0 |
|
run external |
|
run buildall |
TPC-H: Total hot run time: 41665 ms |
TPC-DS: Total hot run time: 186120 ms |
|
TeamCity be ut coverage result: |
eldenmoon
left a comment
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
|
PR approved by at least one committer and no changes requested. |
Proposed changes
in this pr we will do:
Further comments
If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...