github-actions[bot] commented on code in PR #39472:
URL: https://github.com/apache/doris/pull/39472#discussion_r1719418414
##########
be/src/vec/functions/function_multi_match.cpp:
##########
@@ -49,91 +49,59 @@ Status FunctionMultiMatch::execute_impl(FunctionContext*
/*context*/, Block& blo
return Status::RuntimeError("only inverted index queries are supported");
}
-Status FunctionMultiMatch::open(FunctionContext* context,
- FunctionContext::FunctionStateScope scope) {
- if (scope == FunctionContext::THREAD_LOCAL) {
- return Status::OK();
- }
-
- DCHECK(context->get_num_args() == 4);
- for (int i = 0; i < context->get_num_args(); ++i) {
- DCHECK(is_string_type(context->get_arg_type(i)->type));
+InvertedIndexQueryType get_query_type(const std::string& query_type) {
+ if (query_type == "phrase_prefix") {
+ return InvertedIndexQueryType::MATCH_PHRASE_PREFIX_QUERY;
}
+ return InvertedIndexQueryType::UNKNOWN_QUERY;
+}
- std::shared_ptr<MatchParam> state = std::make_shared<MatchParam>();
- context->set_function_state(scope, state);
- for (int i = 0; i < context->get_num_args(); ++i) {
- const auto& const_column_ptr = context->get_constant_col(i);
- if (const_column_ptr) {
- auto const_data = const_column_ptr->column_ptr->get_data_at(0);
- switch (i) {
- case 1: {
- std::string field_names_str = const_data.to_string();
- field_names_str.erase(
- std::remove_if(field_names_str.begin(),
field_names_str.end(),
- [](unsigned char c) { return
std::isspace(c); }),
- field_names_str.end());
- std::vector<std::string> field_names;
- boost::split(field_names, field_names_str,
boost::algorithm::is_any_of(","));
- for (const auto& field_name : field_names) {
- if (!field_name.empty()) {
- state->fields.insert(field_name);
- }
- }
- } break;
- case 2:
- state->type = const_data.to_string();
- break;
- case 3:
- state->query = const_data.to_string();
- break;
- default:
- break;
- }
+Status FunctionMultiMatch::eval_inverted_index(VExpr* expr,
segment_v2::FuncExprParams& params,
Review Comment:
warning: function 'eval_inverted_index' exceeds recommended size/complexity
thresholds [readability-function-size]
```cpp
Status FunctionMultiMatch::eval_inverted_index(VExpr* expr,
segment_v2::FuncExprParams& params,
^
```
<details>
<summary>Additional context</summary>
**be/src/vec/functions/function_multi_match.cpp:58:** 91 lines including
whitespace and comments (threshold 80)
```cpp
Status FunctionMultiMatch::eval_inverted_index(VExpr* expr,
segment_v2::FuncExprParams& params,
^
```
</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]