[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. |
| 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.
|
|
||
| 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.
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.
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.
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.
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.
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 {| // 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.
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.
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.
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.
how about those non-array expr be processed in this situation?
There was a problem hiding this comment.
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 |
|
PR approved by at least one committer and no changes requested. |
|
run buildall |
|
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: |
|
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...