github-actions[bot] commented on code in PR #42932:
URL: https://github.com/apache/doris/pull/42932#discussion_r1822463890


##########
be/src/olap/rowset/segment_v2/inverted_index/query/phrase_query/phrase_matcher.h:
##########
@@ -0,0 +1,71 @@
+// 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/search/query/TermPositionIterator.h>

Review Comment:
   warning: 'CLucene/search/query/TermPositionIterator.h' file not found 
[clang-diagnostic-error]
   ```cpp
   #include <CLucene/search/query/TermPositionIterator.h>
            ^
   ```
   



##########
be/src/olap/rowset/segment_v2/inverted_index/util/bit_set.h:
##########
@@ -0,0 +1,36 @@
+// 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/util/bits.h"
+
+namespace doris::segment_v2::inverted_index {
+
+template <typename Derived>
+class BitSet : public Bits<Derived> {
+public:
+    void clear() { clear(0, length()); }

Review Comment:
   warning: use of undeclared identifier 'length' [clang-diagnostic-error]
   ```cpp
       void clear() { clear(0, length()); }
                               ^
   ```
   



##########
be/src/olap/rowset/segment_v2/inverted_index/query/phrase_query/phrase_positions.h:
##########
@@ -0,0 +1,59 @@
+// 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/search/query/TermPositionIterator.h>

Review Comment:
   warning: 'CLucene/search/query/TermPositionIterator.h' file not found 
[clang-diagnostic-error]
   ```cpp
   #include <CLucene/search/query/TermPositionIterator.h>
            ^
   ```
   



##########
be/src/olap/rowset/segment_v2/inverted_index/util/bit_set.h:
##########
@@ -0,0 +1,36 @@
+// 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/util/bits.h"
+
+namespace doris::segment_v2::inverted_index {
+
+template <typename Derived>
+class BitSet : public Bits<Derived> {
+public:
+    void clear() { clear(0, length()); }
+
+    void set(int32_t i) { derived()->set_impl(i); }

Review Comment:
   warning: unknown type name 'int32_t' [clang-diagnostic-error]
   ```cpp
       void set(int32_t i) { derived()->set_impl(i); }
                ^
   ```
   



##########
be/src/olap/rowset/segment_v2/inverted_index/util/bit_set.h:
##########
@@ -0,0 +1,36 @@
+// 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/util/bits.h"
+
+namespace doris::segment_v2::inverted_index {
+
+template <typename Derived>
+class BitSet : public Bits<Derived> {
+public:
+    void clear() { clear(0, length()); }
+
+    void set(int32_t i) { derived()->set_impl(i); }

Review Comment:
   warning: use of undeclared identifier 'derived'; did you mean 'Derived'? 
[clang-diagnostic-error]
   ```cpp
       void set(int32_t i) { derived()->set_impl(i); }
                             ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/olap/rowset/segment_v2/inverted_index/util/bit_set.h:23:** 
'Derived' declared here
   ```cpp
   template <typename Derived>
                      ^
   ```
   
   </details>
   



##########
be/src/olap/rowset/segment_v2/inverted_index/util/bit_set.h:
##########
@@ -0,0 +1,36 @@
+// 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/util/bits.h"
+
+namespace doris::segment_v2::inverted_index {
+
+template <typename Derived>
+class BitSet : public Bits<Derived> {
+public:
+    void clear() { clear(0, length()); }
+
+    void set(int32_t i) { derived()->set_impl(i); }
+
+    void clear(int32_t i) { derived()->clear_impl(i); }
+
+    void clear(int32_t start_index, int32_t end_index) { 
derived()->clear_impl(start_index, end_index); }

Review Comment:
   warning: use of undeclared identifier 'derived'; did you mean 'Derived'? 
[clang-diagnostic-error]
   ```cpp
       void clear(int32_t start_index, int32_t end_index) { 
derived()->clear_impl(start_index, end_index); }
                                                            ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/olap/rowset/segment_v2/inverted_index/util/bit_set.h:23:** 
'Derived' declared here
   ```cpp
   template <typename Derived>
                      ^
   ```
   
   </details>
   



##########
be/src/olap/rowset/segment_v2/inverted_index/util/bit_set.h:
##########
@@ -0,0 +1,36 @@
+// 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/util/bits.h"
+
+namespace doris::segment_v2::inverted_index {
+
+template <typename Derived>
+class BitSet : public Bits<Derived> {
+public:
+    void clear() { clear(0, length()); }
+
+    void set(int32_t i) { derived()->set_impl(i); }
+
+    void clear(int32_t i) { derived()->clear_impl(i); }

Review Comment:
   warning: unknown type name 'int32_t' [clang-diagnostic-error]
   ```cpp
       void clear(int32_t i) { derived()->clear_impl(i); }
                  ^
   ```
   



##########
be/src/olap/rowset/segment_v2/inverted_index/util/bit_set.h:
##########
@@ -0,0 +1,36 @@
+// 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/util/bits.h"
+
+namespace doris::segment_v2::inverted_index {
+
+template <typename Derived>
+class BitSet : public Bits<Derived> {
+public:
+    void clear() { clear(0, length()); }
+
+    void set(int32_t i) { derived()->set_impl(i); }
+
+    void clear(int32_t i) { derived()->clear_impl(i); }
+
+    void clear(int32_t start_index, int32_t end_index) { 
derived()->clear_impl(start_index, end_index); }

Review Comment:
   warning: unknown type name 'int32_t' [clang-diagnostic-error]
   ```cpp
       void clear(int32_t start_index, int32_t end_index) { 
derived()->clear_impl(start_index, end_index); }
                                       ^
   ```
   



##########
be/src/olap/rowset/segment_v2/inverted_index/util/priority_queue.h:
##########
@@ -0,0 +1,150 @@
+// 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
+
+namespace doris::segment_v2::inverted_index {
+
+template <typename T>
+class PriorityQueue {
+public:
+    PriorityQueue(size_t max_size, std::function<T()> sentinel_object_supplier 
= nullptr) {

Review Comment:
   warning: cannot initialize a parameter of type 'int' with an rvalue of type 
'std::nullptr_t' [clang-diagnostic-error]
   ```cpp
       PriorityQueue(size_t max_size, std::function<T()> 
sentinel_object_supplier = nullptr) {
                                                         ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/olap/rowset/segment_v2/inverted_index/util/priority_queue.h:24:** 
passing argument to parameter 'sentinel_object_supplier' here
   ```cpp
       PriorityQueue(size_t max_size, std::function<T()> 
sentinel_object_supplier = nullptr) {
                                                         ^
   ```
   
   </details>
   



##########
be/src/olap/rowset/segment_v2/inverted_index/util/fixed_bit_set.h:
##########
@@ -0,0 +1,117 @@
+// 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 <memory>
+
+#include "common/exception.h"
+#include "olap/rowset/segment_v2/inverted_index/util/bit_set.h"
+
+namespace doris::segment_v2::inverted_index {
+
+class FixedBitSet : public BitSet<FixedBitSet> {
+public:
+    FixedBitSet(uint32_t num_bits) {
+        _num_bits = num_bits;
+        _bits.resize(bits2words(num_bits));
+        _num_words = _bits.size();
+    }
+
+    bool get(uint32_t index) {
+        assert(index < _num_bits);
+        uint32_t i = index >> 6;
+        uint64_t bit_mask = 1ULL << (index % 64);
+        return (_bits[i] & bit_mask) != 0;
+    }
+
+    void set(uint32_t index) {
+        assert(index < _num_bits);
+        uint32_t word_num = index >> 6;
+        uint64_t bit_mask = 1ULL << (index % 64);
+        _bits[word_num] |= bit_mask;
+    }
+
+    void clear(uint32_t index) {
+        assert(index < _num_bits);
+        uint32_t word_num = index >> 6;
+        uint64_t bit_mask = 1ULL << (index % 64);
+        _bits[word_num] &= ~bit_mask;
+    }
+
+    void clear(uint32_t start_index, uint32_t end_index) {
+        assert(start_index < _num_bits);
+        assert(end_index <= _num_bits);
+        if (end_index <= start_index) {
+            return;
+        }
+
+        uint32_t start_word = start_index >> 6;
+        uint32_t end_word = (end_index - 1) >> 6;
+
+        uint64_t start_mask = ~((1ULL << (start_index % 64)) - 1);
+        uint64_t end_mask = (1ULL << (end_index % 64)) - 1;
+
+        start_mask = ~start_mask;
+        end_mask = ~end_mask;
+
+        if (start_word == end_word) {
+            _bits[start_word] &= (start_mask & end_mask);
+            return;
+        }
+
+        _bits[start_word] &= start_mask;
+        for (uint32_t i = start_word + 1; i < end_word; ++i) {
+            _bits[i] = 0;
+        }
+        _bits[end_word] &= end_mask;
+    }
+
+    void ensure_capacity(size_t num_bits) {

Review Comment:
   warning: method 'ensure_capacity' can be made const 
[readability-make-member-function-const]
   
   ```suggestion
       void ensure_capacity(size_t num_bits) const {
   ```
   



##########
be/src/olap/rowset/segment_v2/inverted_index/util/priority_queue.h:
##########
@@ -0,0 +1,150 @@
+// 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
+
+namespace doris::segment_v2::inverted_index {
+
+template <typename T>
+class PriorityQueue {
+public:
+    PriorityQueue(size_t max_size, std::function<T()> sentinel_object_supplier 
= nullptr) {
+        size_t heap_size = (max_size == 0) ? 2 : max_size + 1;
+        _heap.resize(heap_size);
+        _max_size = max_size;
+
+        if (sentinel_object_supplier) {
+            for (size_t i = 1; i < _heap.size(); i++) {

Review Comment:
   warning: unknown type name 'size_t' [clang-diagnostic-error]
   ```cpp
               for (size_t i = 1; i < _heap.size(); i++) {
                    ^
   ```
   



##########
be/src/olap/rowset/segment_v2/inverted_index/util/priority_queue.h:
##########
@@ -0,0 +1,150 @@
+// 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
+
+namespace doris::segment_v2::inverted_index {
+
+template <typename T>
+class PriorityQueue {
+public:
+    PriorityQueue(size_t max_size, std::function<T()> sentinel_object_supplier 
= nullptr) {
+        size_t heap_size = (max_size == 0) ? 2 : max_size + 1;
+        _heap.resize(heap_size);
+        _max_size = max_size;
+
+        if (sentinel_object_supplier) {
+            for (size_t i = 1; i < _heap.size(); i++) {
+                _heap[i] = sentinel_object_supplier();
+            }
+            _size = max_size;
+        }
+    }
+
+    virtual ~PriorityQueue() = default;
+
+    T add(const T& element) {
+        assert(_size + 1 <= _max_size);
+        size_t index = ++_size;

Review Comment:
   warning: use of undeclared identifier 'size_t'; did you mean 'sizeof'? 
[clang-diagnostic-error]
   
   ```suggestion
           sizeof index = ++_size;
   ```
   



##########
be/src/olap/rowset/segment_v2/inverted_index/util/priority_queue.h:
##########
@@ -0,0 +1,150 @@
+// 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
+
+namespace doris::segment_v2::inverted_index {
+
+template <typename T>
+class PriorityQueue {
+public:
+    PriorityQueue(size_t max_size, std::function<T()> sentinel_object_supplier 
= nullptr) {
+        size_t heap_size = (max_size == 0) ? 2 : max_size + 1;
+        _heap.resize(heap_size);
+        _max_size = max_size;
+
+        if (sentinel_object_supplier) {
+            for (size_t i = 1; i < _heap.size(); i++) {
+                _heap[i] = sentinel_object_supplier();
+            }
+            _size = max_size;
+        }
+    }
+
+    virtual ~PriorityQueue() = default;
+
+    T add(const T& element) {
+        assert(_size + 1 <= _max_size);
+        size_t index = ++_size;

Review Comment:
   warning: use of undeclared identifier 'index' [clang-diagnostic-error]
   ```cpp
           size_t index = ++_size;
                  ^
   ```
   



##########
be/src/olap/rowset/segment_v2/inverted_index/query/phrase_query/phrase_positions.h:
##########
@@ -0,0 +1,59 @@
+// 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/search/query/TermPositionIterator.h>
+
+namespace doris::segment_v2::inverted_index {
+
+class PhrasePositions {
+public:
+    PhrasePositions(const TermPositionIterator& postings, int32_t o, int32_t 
ord,
+                    const std::vector<std::string>& terms) {
+        _postings = postings;
+        _offset = o;
+        _ord = ord;
+        _terms = terms;
+    }
+
+    void first_position() {
+        _count = _postings.freq();
+        next_position();
+    }
+
+    bool next_position() {
+        if (_count-- > 0) {
+            _position = _postings.nextPosition() - _offset;
+            return true;

Review Comment:
   warning: redundant boolean literal in conditional return statement 
[readability-simplify-boolean-expr]
   
   
be/src/olap/rowset/segment_v2/inverted_index/query/phrase_query/phrase_positions.h:39:
   ```diff
   -         if (_count-- > 0) {
   -             _position = _postings.nextPosition() - _offset;
   -             return true;
   -         } else {
   -             return false;
   -         }
   +         return _count-- > 0;
   ```
   



##########
be/src/olap/rowset/segment_v2/inverted_index/util/bit_set.h:
##########
@@ -0,0 +1,36 @@
+// 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/util/bits.h"
+
+namespace doris::segment_v2::inverted_index {
+
+template <typename Derived>
+class BitSet : public Bits<Derived> {
+public:
+    void clear() { clear(0, length()); }
+
+    void set(int32_t i) { derived()->set_impl(i); }
+
+    void clear(int32_t i) { derived()->clear_impl(i); }
+
+    void clear(int32_t start_index, int32_t end_index) { 
derived()->clear_impl(start_index, end_index); }

Review Comment:
   warning: unknown type name 'int32_t' [clang-diagnostic-error]
   ```cpp
       void clear(int32_t start_index, int32_t end_index) { 
derived()->clear_impl(start_index, end_index); }
                  ^
   ```
   



##########
be/src/olap/rowset/segment_v2/inverted_index/util/bit_set.h:
##########
@@ -0,0 +1,36 @@
+// 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/util/bits.h"
+
+namespace doris::segment_v2::inverted_index {
+
+template <typename Derived>
+class BitSet : public Bits<Derived> {
+public:
+    void clear() { clear(0, length()); }
+
+    void set(int32_t i) { derived()->set_impl(i); }
+
+    void clear(int32_t i) { derived()->clear_impl(i); }

Review Comment:
   warning: use of undeclared identifier 'derived'; did you mean 'Derived'? 
[clang-diagnostic-error]
   ```cpp
       void clear(int32_t i) { derived()->clear_impl(i); }
                               ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/olap/rowset/segment_v2/inverted_index/util/bit_set.h:23:** 
'Derived' declared here
   ```cpp
   template <typename Derived>
                      ^
   ```
   
   </details>
   



##########
be/src/olap/rowset/segment_v2/inverted_index/util/priority_queue.h:
##########
@@ -0,0 +1,150 @@
+// 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
+
+namespace doris::segment_v2::inverted_index {
+
+template <typename T>
+class PriorityQueue {
+public:
+    PriorityQueue(size_t max_size, std::function<T()> sentinel_object_supplier 
= nullptr) {

Review Comment:
   warning: unknown type name 'size_t' [clang-diagnostic-error]
   ```cpp
       PriorityQueue(size_t max_size, std::function<T()> 
sentinel_object_supplier = nullptr) {
                     ^
   ```
   



##########
be/src/olap/rowset/segment_v2/inverted_index/util/priority_queue.h:
##########
@@ -0,0 +1,150 @@
+// 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
+
+namespace doris::segment_v2::inverted_index {
+
+template <typename T>
+class PriorityQueue {
+public:
+    PriorityQueue(size_t max_size, std::function<T()> sentinel_object_supplier 
= nullptr) {

Review Comment:
   warning: use of undeclared identifier 'std' [clang-diagnostic-error]
   ```cpp
       PriorityQueue(size_t max_size, std::function<T()> 
sentinel_object_supplier = nullptr) {
                                      ^
   ```
   



##########
be/src/olap/rowset/segment_v2/inverted_index/util/bits.h:
##########
@@ -0,0 +1,38 @@
+// 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
+
+namespace doris::segment_v2::inverted_index {
+
+template <typename Derived>
+class Bits {
+public:
+  bool get(int32_t index) {
+    derived()->get_impl();
+  }
+
+  int32_t length() {

Review Comment:
   warning: unknown type name 'int32_t' [clang-diagnostic-error]
   ```cpp
     int32_t length() {
     ^
   ```
   



##########
be/src/olap/rowset/segment_v2/inverted_index/util/bits.h:
##########
@@ -0,0 +1,38 @@
+// 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
+
+namespace doris::segment_v2::inverted_index {
+
+template <typename Derived>
+class Bits {
+public:
+  bool get(int32_t index) {

Review Comment:
   warning: unknown type name 'int32_t' [clang-diagnostic-error]
   ```cpp
     bool get(int32_t index) {
              ^
   ```
   



##########
be/src/olap/rowset/segment_v2/inverted_index/util/priority_queue.h:
##########
@@ -0,0 +1,150 @@
+// 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
+
+namespace doris::segment_v2::inverted_index {
+
+template <typename T>
+class PriorityQueue {
+public:
+    PriorityQueue(size_t max_size, std::function<T()> sentinel_object_supplier 
= nullptr) {
+        size_t heap_size = (max_size == 0) ? 2 : max_size + 1;
+        _heap.resize(heap_size);
+        _max_size = max_size;
+
+        if (sentinel_object_supplier) {
+            for (size_t i = 1; i < _heap.size(); i++) {
+                _heap[i] = sentinel_object_supplier();
+            }
+            _size = max_size;
+        }
+    }
+
+    virtual ~PriorityQueue() = default;
+
+    T add(const T& element) {
+        assert(_size + 1 <= _max_size);
+        size_t index = ++_size;
+        _heap[index] = element;
+        up_heap(index);

Review Comment:
   warning: use of undeclared identifier 'index' [clang-diagnostic-error]
   ```cpp
           up_heap(index);
                   ^
   ```
   



##########
be/src/olap/rowset/segment_v2/inverted_index/util/priority_queue.h:
##########
@@ -0,0 +1,150 @@
+// 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
+
+namespace doris::segment_v2::inverted_index {
+
+template <typename T>
+class PriorityQueue {
+public:
+    PriorityQueue(size_t max_size, std::function<T()> sentinel_object_supplier 
= nullptr) {
+        size_t heap_size = (max_size == 0) ? 2 : max_size + 1;

Review Comment:
   warning: use of undeclared identifier 'heap_size'; did you mean 'max_size'? 
[clang-diagnostic-error]
   
   ```suggestion
           size_t max_size = (max_size == 0) ? 2 : max_size + 1;
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/olap/rowset/segment_v2/inverted_index/util/priority_queue.h:24:** 
'max_size' declared here
   ```cpp
       PriorityQueue(size_t max_size, std::function<T()> 
sentinel_object_supplier = nullptr) {
                            ^
   ```
   
   </details>
   



##########
be/src/olap/rowset/segment_v2/inverted_index/util/priority_queue.h:
##########
@@ -0,0 +1,150 @@
+// 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
+
+namespace doris::segment_v2::inverted_index {
+
+template <typename T>
+class PriorityQueue {
+public:
+    PriorityQueue(size_t max_size, std::function<T()> sentinel_object_supplier 
= nullptr) {
+        size_t heap_size = (max_size == 0) ? 2 : max_size + 1;
+        _heap.resize(heap_size);

Review Comment:
   warning: use of undeclared identifier 'heap_size' [clang-diagnostic-error]
   ```cpp
           _heap.resize(heap_size);
                        ^
   ```
   



##########
be/src/olap/rowset/segment_v2/inverted_index/util/priority_queue.h:
##########
@@ -0,0 +1,150 @@
+// 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
+
+namespace doris::segment_v2::inverted_index {
+
+template <typename T>
+class PriorityQueue {
+public:
+    PriorityQueue(size_t max_size, std::function<T()> sentinel_object_supplier 
= nullptr) {
+        size_t heap_size = (max_size == 0) ? 2 : max_size + 1;

Review Comment:
   warning: use of undeclared identifier 'size_t'; did you mean 'sizeof'? 
[clang-diagnostic-error]
   
   ```suggestion
           sizeof heap_size = (max_size == 0) ? 2 : max_size + 1;
   ```
   



##########
be/src/olap/rowset/segment_v2/inverted_index/util/priority_queue.h:
##########
@@ -0,0 +1,150 @@
+// 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
+
+namespace doris::segment_v2::inverted_index {
+
+template <typename T>
+class PriorityQueue {
+public:
+    PriorityQueue(size_t max_size, std::function<T()> sentinel_object_supplier 
= nullptr) {
+        size_t heap_size = (max_size == 0) ? 2 : max_size + 1;
+        _heap.resize(heap_size);
+        _max_size = max_size;
+
+        if (sentinel_object_supplier) {
+            for (size_t i = 1; i < _heap.size(); i++) {
+                _heap[i] = sentinel_object_supplier();
+            }
+            _size = max_size;
+        }
+    }
+
+    virtual ~PriorityQueue() = default;
+
+    T add(const T& element) {
+        assert(_size + 1 <= _max_size);
+        size_t index = ++_size;
+        _heap[index] = element;

Review Comment:
   warning: use of undeclared identifier 'index' [clang-diagnostic-error]
   ```cpp
           _heap[index] = element;
                 ^
   ```
   



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org


Reply via email to