github-actions[bot] commented on code in PR #29771: URL: https://github.com/apache/doris/pull/29771#discussion_r1446859694
########## be/src/olap/rowset/segment_v2/inverted_index/query/query.h: ########## @@ -0,0 +1,44 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#pragma once + +#include <CLucene.h> Review Comment: warning: 'CLucene.h' file not found [clang-diagnostic-error] ```cpp #include <CLucene.h> ^ ``` ########## be/src/olap/rowset/segment_v2/inverted_index/query/query_factory.h: ########## @@ -0,0 +1,50 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#pragma once + +#include "olap/rowset/segment_v2/inverted_index_query_type.h" + +namespace doris::segment_v2 { + +class Query; +class DisjunctionQuery; +class ConjunctionQuery; +class PhraseQuery; +class PhrasePrefixQuery; +class RegexpQuery; + +class QueryFactory { +public: + template <typename... Args> + static std::unique_ptr<Query> create(InvertedIndexQueryType query_type, Args&&... args) { Review Comment: warning: no template named 'unique_ptr' in namespace 'std' [clang-diagnostic-error] ```cpp static std::unique_ptr<Query> create(InvertedIndexQueryType query_type, Args&&... args) { ^ ``` ########## be/src/olap/rowset/segment_v2/inverted_index/query/query_factory.h: ########## @@ -0,0 +1,50 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#pragma once + +#include "olap/rowset/segment_v2/inverted_index_query_type.h" + +namespace doris::segment_v2 { + +class Query; +class DisjunctionQuery; +class ConjunctionQuery; +class PhraseQuery; +class PhrasePrefixQuery; +class RegexpQuery; + +class QueryFactory { +public: + template <typename... Args> + static std::unique_ptr<Query> create(InvertedIndexQueryType query_type, Args&&... args) { + if (query_type == InvertedIndexQueryType::MATCH_ANY_QUERY) { + return std::make_unique<DisjunctionQuery>(std::forward<Args>(args)...); Review Comment: warning: expected ')' [clang-diagnostic-error] ```cpp return std::make_unique<DisjunctionQuery>(std::forward<Args>(args)...); ^ ``` <details> <summary>Additional context</summary> **be/src/olap/rowset/segment_v2/inverted_index/query/query_factory.h:35:** to match this '(' ```cpp return std::make_unique<DisjunctionQuery>(std::forward<Args>(args)...); ^ ``` </details> ########## be/src/olap/rowset/segment_v2/inverted_index/query/query_factory.h: ########## @@ -0,0 +1,50 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#pragma once + +#include "olap/rowset/segment_v2/inverted_index_query_type.h" + +namespace doris::segment_v2 { + +class Query; +class DisjunctionQuery; +class ConjunctionQuery; +class PhraseQuery; +class PhrasePrefixQuery; +class RegexpQuery; + +class QueryFactory { +public: + template <typename... Args> + static std::unique_ptr<Query> create(InvertedIndexQueryType query_type, Args&&... args) { + if (query_type == InvertedIndexQueryType::MATCH_ANY_QUERY) { + return std::make_unique<DisjunctionQuery>(std::forward<Args>(args)...); + } else if (query_type == InvertedIndexQueryType::MATCH_ALL_QUERY) { + return std::make_unique<ConjunctionQuery>(std::forward<Args>(args)...); + } else if (query_type == InvertedIndexQueryType::MATCH_PHRASE_QUERY) { + return std::make_unique<PhraseQuery>(std::forward<Args>(args)...); Review Comment: warning: no member named 'make_unique' in namespace 'std' [clang-diagnostic-error] ```cpp return std::make_unique<PhraseQuery>(std::forward<Args>(args)...); ^ ``` ########## be/src/olap/rowset/segment_v2/inverted_index/query/query_factory.h: ########## @@ -0,0 +1,50 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#pragma once + +#include "olap/rowset/segment_v2/inverted_index_query_type.h" + +namespace doris::segment_v2 { + +class Query; +class DisjunctionQuery; +class ConjunctionQuery; +class PhraseQuery; +class PhrasePrefixQuery; +class RegexpQuery; + +class QueryFactory { +public: + template <typename... Args> + static std::unique_ptr<Query> create(InvertedIndexQueryType query_type, Args&&... args) { + if (query_type == InvertedIndexQueryType::MATCH_ANY_QUERY) { + return std::make_unique<DisjunctionQuery>(std::forward<Args>(args)...); + } else if (query_type == InvertedIndexQueryType::MATCH_ALL_QUERY) { + return std::make_unique<ConjunctionQuery>(std::forward<Args>(args)...); + } else if (query_type == InvertedIndexQueryType::MATCH_PHRASE_QUERY) { + return std::make_unique<PhraseQuery>(std::forward<Args>(args)...); + } else if (query_type == InvertedIndexQueryType::MATCH_PHRASE_PREFIX_QUERY) { + return std::make_unique<PhrasePrefixQuery>(std::forward<Args>(args)...); + } else if (query_type == InvertedIndexQueryType::MATCH_REGEXP_QUERY) { + return std::make_unique<RegexpQuery>(std::forward<Args>(args)...); Review Comment: warning: expected ')' [clang-diagnostic-error] ```cpp return std::make_unique<RegexpQuery>(std::forward<Args>(args)...); ^ ``` <details> <summary>Additional context</summary> **be/src/olap/rowset/segment_v2/inverted_index/query/query_factory.h:43:** to match this '(' ```cpp return std::make_unique<RegexpQuery>(std::forward<Args>(args)...); ^ ``` </details> ########## be/src/olap/rowset/segment_v2/inverted_index_reader.cpp: ########## @@ -499,73 +489,20 @@ Status FullTextIndexReader::normal_index_search( return Status::OK(); } -Status FullTextIndexReader::match_all_index_search( - OlapReaderStatistics* stats, RuntimeState* runtime_state, const std::wstring& field_ws, - const std::vector<std::string>& analyse_result, - const FulltextIndexSearcherPtr& index_searcher, - const std::shared_ptr<roaring::Roaring>& term_match_bitmap) { - TQueryOptions queryOptions = runtime_state->query_options(); - try { - SCOPED_RAW_TIMER(&stats->inverted_index_searcher_search_timer); - ConjunctionQuery query(index_searcher->getReader()); - query.set_conjunction_ratio(queryOptions.inverted_index_conjunction_opt_threshold); - query.add(field_ws, analyse_result); - query.search(*term_match_bitmap); - } catch (const CLuceneError& e) { - return Status::Error<ErrorCode::INVERTED_INDEX_CLUCENE_ERROR>("CLuceneError occured: {}", - e.what()); - } - return Status::OK(); -} - -Status FullTextIndexReader::match_phrase_index_search( - OlapReaderStatistics* stats, RuntimeState* runtime_state, const std::wstring& field_ws, - const std::vector<std::string>& analyse_result, - const FulltextIndexSearcherPtr& index_searcher, - const std::shared_ptr<roaring::Roaring>& term_match_bitmap) { - TQueryOptions queryOptions = runtime_state->query_options(); - try { - SCOPED_RAW_TIMER(&stats->inverted_index_searcher_search_timer); - PhraseQuery query(index_searcher); - query.add(field_ws, analyse_result); - query.search(*term_match_bitmap); - } catch (const CLuceneError& e) { - return Status::Error<ErrorCode::INVERTED_INDEX_CLUCENE_ERROR>("CLuceneError occured: {}", - e.what()); - } - return Status::OK(); -} - -Status FullTextIndexReader::match_phrase_prefix_index_search( - OlapReaderStatistics* stats, RuntimeState* runtime_state, const std::wstring& field_ws, - const std::vector<std::string>& analyse_result, +Status FullTextIndexReader::match_index_search( Review Comment: warning: method 'match_index_search' can be made static [readability-convert-member-functions-to-static] ```suggestion static Status FullTextIndexReader::match_index_search( ``` ########## be/src/olap/rowset/segment_v2/inverted_index/query/query_factory.h: ########## @@ -0,0 +1,50 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#pragma once + +#include "olap/rowset/segment_v2/inverted_index_query_type.h" + +namespace doris::segment_v2 { + +class Query; +class DisjunctionQuery; +class ConjunctionQuery; +class PhraseQuery; +class PhrasePrefixQuery; +class RegexpQuery; + +class QueryFactory { +public: + template <typename... Args> + static std::unique_ptr<Query> create(InvertedIndexQueryType query_type, Args&&... args) { + if (query_type == InvertedIndexQueryType::MATCH_ANY_QUERY) { + return std::make_unique<DisjunctionQuery>(std::forward<Args>(args)...); + } else if (query_type == InvertedIndexQueryType::MATCH_ALL_QUERY) { + return std::make_unique<ConjunctionQuery>(std::forward<Args>(args)...); Review Comment: warning: 'ConjunctionQuery' does not refer to a value [clang-diagnostic-error] ```cpp return std::make_unique<ConjunctionQuery>(std::forward<Args>(args)...); ^ ``` <details> <summary>Additional context</summary> **be/src/olap/rowset/segment_v2/inverted_index/query/query_factory.h:25:** declared here ```cpp class ConjunctionQuery; ^ ``` </details> ########## be/src/olap/rowset/segment_v2/inverted_index/query/phrase_prefix_query.h: ########## @@ -17,38 +17,25 @@ #pragma once -#include <CLucene.h> -#include <CLucene/index/IndexReader.h> - -#include <memory> - #include "CLucene/search/MultiPhraseQuery.h" Review Comment: warning: 'CLucene/search/MultiPhraseQuery.h' file not found [clang-diagnostic-error] ```cpp #include "CLucene/search/MultiPhraseQuery.h" ^ ``` ########## be/src/olap/rowset/segment_v2/inverted_index/query/query_factory.h: ########## @@ -0,0 +1,50 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#pragma once + +#include "olap/rowset/segment_v2/inverted_index_query_type.h" + +namespace doris::segment_v2 { + +class Query; +class DisjunctionQuery; +class ConjunctionQuery; +class PhraseQuery; +class PhrasePrefixQuery; +class RegexpQuery; + +class QueryFactory { +public: + template <typename... Args> + static std::unique_ptr<Query> create(InvertedIndexQueryType query_type, Args&&... args) { + if (query_type == InvertedIndexQueryType::MATCH_ANY_QUERY) { + return std::make_unique<DisjunctionQuery>(std::forward<Args>(args)...); Review Comment: warning: no member named 'make_unique' in namespace 'std' [clang-diagnostic-error] ```cpp return std::make_unique<DisjunctionQuery>(std::forward<Args>(args)...); ^ ``` ########## be/src/olap/rowset/segment_v2/inverted_index/query/query_factory.h: ########## @@ -0,0 +1,50 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#pragma once + +#include "olap/rowset/segment_v2/inverted_index_query_type.h" + +namespace doris::segment_v2 { + +class Query; +class DisjunctionQuery; +class ConjunctionQuery; +class PhraseQuery; +class PhrasePrefixQuery; +class RegexpQuery; + +class QueryFactory { +public: + template <typename... Args> + static std::unique_ptr<Query> create(InvertedIndexQueryType query_type, Args&&... args) { + if (query_type == InvertedIndexQueryType::MATCH_ANY_QUERY) { + return std::make_unique<DisjunctionQuery>(std::forward<Args>(args)...); Review Comment: warning: 'DisjunctionQuery' does not refer to a value [clang-diagnostic-error] ```cpp return std::make_unique<DisjunctionQuery>(std::forward<Args>(args)...); ^ ``` <details> <summary>Additional context</summary> **be/src/olap/rowset/segment_v2/inverted_index/query/query_factory.h:24:** declared here ```cpp class DisjunctionQuery; ^ ``` </details> ########## be/src/olap/rowset/segment_v2/inverted_index/query/query_factory.h: ########## @@ -0,0 +1,50 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#pragma once + +#include "olap/rowset/segment_v2/inverted_index_query_type.h" + +namespace doris::segment_v2 { + +class Query; +class DisjunctionQuery; +class ConjunctionQuery; +class PhraseQuery; +class PhrasePrefixQuery; +class RegexpQuery; + +class QueryFactory { +public: + template <typename... Args> + static std::unique_ptr<Query> create(InvertedIndexQueryType query_type, Args&&... args) { + if (query_type == InvertedIndexQueryType::MATCH_ANY_QUERY) { + return std::make_unique<DisjunctionQuery>(std::forward<Args>(args)...); + } else if (query_type == InvertedIndexQueryType::MATCH_ALL_QUERY) { + return std::make_unique<ConjunctionQuery>(std::forward<Args>(args)...); + } else if (query_type == InvertedIndexQueryType::MATCH_PHRASE_QUERY) { + return std::make_unique<PhraseQuery>(std::forward<Args>(args)...); + } else if (query_type == InvertedIndexQueryType::MATCH_PHRASE_PREFIX_QUERY) { + return std::make_unique<PhrasePrefixQuery>(std::forward<Args>(args)...); Review Comment: warning: expected ')' [clang-diagnostic-error] ```cpp return std::make_unique<PhrasePrefixQuery>(std::forward<Args>(args)...); ^ ``` <details> <summary>Additional context</summary> **be/src/olap/rowset/segment_v2/inverted_index/query/query_factory.h:41:** to match this '(' ```cpp return std::make_unique<PhrasePrefixQuery>(std::forward<Args>(args)...); ^ ``` </details> ########## be/src/olap/rowset/segment_v2/inverted_index/query/query_factory.h: ########## @@ -0,0 +1,50 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#pragma once + +#include "olap/rowset/segment_v2/inverted_index_query_type.h" + +namespace doris::segment_v2 { + +class Query; +class DisjunctionQuery; +class ConjunctionQuery; +class PhraseQuery; +class PhrasePrefixQuery; +class RegexpQuery; + +class QueryFactory { +public: + template <typename... Args> + static std::unique_ptr<Query> create(InvertedIndexQueryType query_type, Args&&... args) { + if (query_type == InvertedIndexQueryType::MATCH_ANY_QUERY) { + return std::make_unique<DisjunctionQuery>(std::forward<Args>(args)...); + } else if (query_type == InvertedIndexQueryType::MATCH_ALL_QUERY) { + return std::make_unique<ConjunctionQuery>(std::forward<Args>(args)...); Review Comment: warning: no member named 'make_unique' in namespace 'std' [clang-diagnostic-error] ```cpp return std::make_unique<ConjunctionQuery>(std::forward<Args>(args)...); ^ ``` ########## be/src/olap/rowset/segment_v2/inverted_index/query/query_factory.h: ########## @@ -0,0 +1,50 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#pragma once + +#include "olap/rowset/segment_v2/inverted_index_query_type.h" + +namespace doris::segment_v2 { + +class Query; +class DisjunctionQuery; +class ConjunctionQuery; +class PhraseQuery; +class PhrasePrefixQuery; +class RegexpQuery; + +class QueryFactory { +public: + template <typename... Args> + static std::unique_ptr<Query> create(InvertedIndexQueryType query_type, Args&&... args) { + if (query_type == InvertedIndexQueryType::MATCH_ANY_QUERY) { + return std::make_unique<DisjunctionQuery>(std::forward<Args>(args)...); + } else if (query_type == InvertedIndexQueryType::MATCH_ALL_QUERY) { + return std::make_unique<ConjunctionQuery>(std::forward<Args>(args)...); + } else if (query_type == InvertedIndexQueryType::MATCH_PHRASE_QUERY) { + return std::make_unique<PhraseQuery>(std::forward<Args>(args)...); Review Comment: warning: 'PhraseQuery' does not refer to a value [clang-diagnostic-error] ```cpp return std::make_unique<PhraseQuery>(std::forward<Args>(args)...); ^ ``` <details> <summary>Additional context</summary> **be/src/olap/rowset/segment_v2/inverted_index/query/query_factory.h:26:** declared here ```cpp class PhraseQuery; ^ ``` </details> ########## be/src/olap/rowset/segment_v2/inverted_index/query/query_factory.h: ########## @@ -0,0 +1,50 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#pragma once + +#include "olap/rowset/segment_v2/inverted_index_query_type.h" + +namespace doris::segment_v2 { + +class Query; +class DisjunctionQuery; +class ConjunctionQuery; +class PhraseQuery; +class PhrasePrefixQuery; +class RegexpQuery; + +class QueryFactory { +public: + template <typename... Args> + static std::unique_ptr<Query> create(InvertedIndexQueryType query_type, Args&&... args) { + if (query_type == InvertedIndexQueryType::MATCH_ANY_QUERY) { + return std::make_unique<DisjunctionQuery>(std::forward<Args>(args)...); + } else if (query_type == InvertedIndexQueryType::MATCH_ALL_QUERY) { + return std::make_unique<ConjunctionQuery>(std::forward<Args>(args)...); Review Comment: warning: expected ')' [clang-diagnostic-error] ```cpp return std::make_unique<ConjunctionQuery>(std::forward<Args>(args)...); ^ ``` <details> <summary>Additional context</summary> **be/src/olap/rowset/segment_v2/inverted_index/query/query_factory.h:37:** to match this '(' ```cpp return std::make_unique<ConjunctionQuery>(std::forward<Args>(args)...); ^ ``` </details> ########## be/src/olap/rowset/segment_v2/inverted_index/query/query_factory.h: ########## @@ -0,0 +1,50 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#pragma once + +#include "olap/rowset/segment_v2/inverted_index_query_type.h" + +namespace doris::segment_v2 { + +class Query; +class DisjunctionQuery; +class ConjunctionQuery; +class PhraseQuery; +class PhrasePrefixQuery; +class RegexpQuery; + +class QueryFactory { +public: + template <typename... Args> + static std::unique_ptr<Query> create(InvertedIndexQueryType query_type, Args&&... args) { + if (query_type == InvertedIndexQueryType::MATCH_ANY_QUERY) { + return std::make_unique<DisjunctionQuery>(std::forward<Args>(args)...); + } else if (query_type == InvertedIndexQueryType::MATCH_ALL_QUERY) { + return std::make_unique<ConjunctionQuery>(std::forward<Args>(args)...); + } else if (query_type == InvertedIndexQueryType::MATCH_PHRASE_QUERY) { + return std::make_unique<PhraseQuery>(std::forward<Args>(args)...); Review Comment: warning: expected ')' [clang-diagnostic-error] ```cpp return std::make_unique<PhraseQuery>(std::forward<Args>(args)...); ^ ``` <details> <summary>Additional context</summary> **be/src/olap/rowset/segment_v2/inverted_index/query/query_factory.h:39:** to match this '(' ```cpp return std::make_unique<PhraseQuery>(std::forward<Args>(args)...); ^ ``` </details> ########## be/src/olap/rowset/segment_v2/inverted_index/query/query_factory.h: ########## @@ -0,0 +1,50 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#pragma once + +#include "olap/rowset/segment_v2/inverted_index_query_type.h" + +namespace doris::segment_v2 { + +class Query; +class DisjunctionQuery; +class ConjunctionQuery; +class PhraseQuery; +class PhrasePrefixQuery; +class RegexpQuery; + +class QueryFactory { +public: + template <typename... Args> + static std::unique_ptr<Query> create(InvertedIndexQueryType query_type, Args&&... args) { + if (query_type == InvertedIndexQueryType::MATCH_ANY_QUERY) { + return std::make_unique<DisjunctionQuery>(std::forward<Args>(args)...); + } else if (query_type == InvertedIndexQueryType::MATCH_ALL_QUERY) { + return std::make_unique<ConjunctionQuery>(std::forward<Args>(args)...); + } else if (query_type == InvertedIndexQueryType::MATCH_PHRASE_QUERY) { + return std::make_unique<PhraseQuery>(std::forward<Args>(args)...); + } else if (query_type == InvertedIndexQueryType::MATCH_PHRASE_PREFIX_QUERY) { + return std::make_unique<PhrasePrefixQuery>(std::forward<Args>(args)...); + } else if (query_type == InvertedIndexQueryType::MATCH_REGEXP_QUERY) { + return std::make_unique<RegexpQuery>(std::forward<Args>(args)...); Review Comment: warning: no member named 'make_unique' in namespace 'std' [clang-diagnostic-error] ```cpp return std::make_unique<RegexpQuery>(std::forward<Args>(args)...); ^ ``` ########## be/src/olap/rowset/segment_v2/inverted_index/query/query_factory.h: ########## @@ -0,0 +1,50 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#pragma once + +#include "olap/rowset/segment_v2/inverted_index_query_type.h" + +namespace doris::segment_v2 { + +class Query; +class DisjunctionQuery; +class ConjunctionQuery; +class PhraseQuery; +class PhrasePrefixQuery; +class RegexpQuery; + +class QueryFactory { +public: + template <typename... Args> + static std::unique_ptr<Query> create(InvertedIndexQueryType query_type, Args&&... args) { + if (query_type == InvertedIndexQueryType::MATCH_ANY_QUERY) { + return std::make_unique<DisjunctionQuery>(std::forward<Args>(args)...); + } else if (query_type == InvertedIndexQueryType::MATCH_ALL_QUERY) { + return std::make_unique<ConjunctionQuery>(std::forward<Args>(args)...); + } else if (query_type == InvertedIndexQueryType::MATCH_PHRASE_QUERY) { + return std::make_unique<PhraseQuery>(std::forward<Args>(args)...); + } else if (query_type == InvertedIndexQueryType::MATCH_PHRASE_PREFIX_QUERY) { + return std::make_unique<PhrasePrefixQuery>(std::forward<Args>(args)...); Review Comment: warning: no member named 'make_unique' in namespace 'std' [clang-diagnostic-error] ```cpp return std::make_unique<PhrasePrefixQuery>(std::forward<Args>(args)...); ^ ``` ########## be/src/olap/rowset/segment_v2/inverted_index/query/query_factory.h: ########## @@ -0,0 +1,50 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#pragma once + +#include "olap/rowset/segment_v2/inverted_index_query_type.h" + +namespace doris::segment_v2 { + +class Query; +class DisjunctionQuery; +class ConjunctionQuery; +class PhraseQuery; +class PhrasePrefixQuery; +class RegexpQuery; + +class QueryFactory { +public: + template <typename... Args> + static std::unique_ptr<Query> create(InvertedIndexQueryType query_type, Args&&... args) { + if (query_type == InvertedIndexQueryType::MATCH_ANY_QUERY) { + return std::make_unique<DisjunctionQuery>(std::forward<Args>(args)...); + } else if (query_type == InvertedIndexQueryType::MATCH_ALL_QUERY) { + return std::make_unique<ConjunctionQuery>(std::forward<Args>(args)...); + } else if (query_type == InvertedIndexQueryType::MATCH_PHRASE_QUERY) { + return std::make_unique<PhraseQuery>(std::forward<Args>(args)...); + } else if (query_type == InvertedIndexQueryType::MATCH_PHRASE_PREFIX_QUERY) { + return std::make_unique<PhrasePrefixQuery>(std::forward<Args>(args)...); + } else if (query_type == InvertedIndexQueryType::MATCH_REGEXP_QUERY) { + return std::make_unique<RegexpQuery>(std::forward<Args>(args)...); + } + return nullptr; Review Comment: warning: cannot initialize return object of type 'int' with an rvalue of type 'std::nullptr_t' [clang-diagnostic-error] ```cpp return nullptr; ^ ``` ########## be/src/olap/rowset/segment_v2/inverted_index/query/query_factory.h: ########## @@ -0,0 +1,50 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#pragma once + +#include "olap/rowset/segment_v2/inverted_index_query_type.h" + +namespace doris::segment_v2 { + +class Query; +class DisjunctionQuery; +class ConjunctionQuery; +class PhraseQuery; +class PhrasePrefixQuery; +class RegexpQuery; + +class QueryFactory { +public: + template <typename... Args> + static std::unique_ptr<Query> create(InvertedIndexQueryType query_type, Args&&... args) { + if (query_type == InvertedIndexQueryType::MATCH_ANY_QUERY) { + return std::make_unique<DisjunctionQuery>(std::forward<Args>(args)...); + } else if (query_type == InvertedIndexQueryType::MATCH_ALL_QUERY) { + return std::make_unique<ConjunctionQuery>(std::forward<Args>(args)...); + } else if (query_type == InvertedIndexQueryType::MATCH_PHRASE_QUERY) { + return std::make_unique<PhraseQuery>(std::forward<Args>(args)...); + } else if (query_type == InvertedIndexQueryType::MATCH_PHRASE_PREFIX_QUERY) { + return std::make_unique<PhrasePrefixQuery>(std::forward<Args>(args)...); Review Comment: warning: 'PhrasePrefixQuery' does not refer to a value [clang-diagnostic-error] ```cpp return std::make_unique<PhrasePrefixQuery>(std::forward<Args>(args)...); ^ ``` <details> <summary>Additional context</summary> **be/src/olap/rowset/segment_v2/inverted_index/query/query_factory.h:27:** declared here ```cpp class PhrasePrefixQuery; ^ ``` </details> ########## be/src/olap/rowset/segment_v2/inverted_index/query/query_factory.h: ########## @@ -0,0 +1,50 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#pragma once + +#include "olap/rowset/segment_v2/inverted_index_query_type.h" + +namespace doris::segment_v2 { + +class Query; +class DisjunctionQuery; +class ConjunctionQuery; +class PhraseQuery; +class PhrasePrefixQuery; +class RegexpQuery; + +class QueryFactory { +public: + template <typename... Args> + static std::unique_ptr<Query> create(InvertedIndexQueryType query_type, Args&&... args) { + if (query_type == InvertedIndexQueryType::MATCH_ANY_QUERY) { + return std::make_unique<DisjunctionQuery>(std::forward<Args>(args)...); + } else if (query_type == InvertedIndexQueryType::MATCH_ALL_QUERY) { + return std::make_unique<ConjunctionQuery>(std::forward<Args>(args)...); + } else if (query_type == InvertedIndexQueryType::MATCH_PHRASE_QUERY) { + return std::make_unique<PhraseQuery>(std::forward<Args>(args)...); + } else if (query_type == InvertedIndexQueryType::MATCH_PHRASE_PREFIX_QUERY) { + return std::make_unique<PhrasePrefixQuery>(std::forward<Args>(args)...); + } else if (query_type == InvertedIndexQueryType::MATCH_REGEXP_QUERY) { + return std::make_unique<RegexpQuery>(std::forward<Args>(args)...); Review Comment: warning: 'RegexpQuery' does not refer to a value [clang-diagnostic-error] ```cpp return std::make_unique<RegexpQuery>(std::forward<Args>(args)...); ^ ``` <details> <summary>Additional context</summary> **be/src/olap/rowset/segment_v2/inverted_index/query/query_factory.h:28:** declared here ```cpp class RegexpQuery; ^ ``` </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]
