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


##########
be/test/vec/aggregate_functions/agg_bitmap_test.cpp:
##########
@@ -0,0 +1,92 @@
+// 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.
+
+#include <glog/logging.h>

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



##########
be/test/vec/aggregate_functions/agg_bitmap_test.cpp:
##########
@@ -0,0 +1,92 @@
+// 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.
+
+#include <glog/logging.h>
+#include <gtest/gtest-message.h>
+#include <gtest/gtest-param-test.h>
+#include <gtest/gtest-test-part.h>
+#include <stddef.h>
+
+#include <memory>
+#include <string>
+#include <vector>
+
+#include "gtest/gtest_pred_impl.h"
+#include "util/bitmap_value.h"
+#include "vec/aggregate_functions/aggregate_function.h"
+#include "vec/aggregate_functions/aggregate_function_simple_factory.h"
+#include "vec/columns/column.h"
+#include "vec/columns/column_complex.h"
+#include "vec/columns/column_string.h"
+#include "vec/columns/column_vector.h"
+#include "vec/columns/columns_number.h"
+#include "vec/common/string_ref.h"
+#include "vec/core/field.h"
+#include "vec/core/types.h"
+#include "vec/data_types/data_type_bitmap.h"
+#include "vec/data_types/data_type_decimal.h"
+#include "vec/data_types/data_type_number.h"
+#include "vec/data_types/data_type_string.h"
+
+const int agg_test_batch_size = 10;
+
+namespace doris::vectorized {
+// declare function
+void register_aggregate_function_bitmap(AggregateFunctionSimpleFactory& 
factory);
+
+TEST(AggBitmapTest, bitmap_union_test) {
+    std::string function_name = "bitmap_union";
+    auto data_type = std::make_shared<DataTypeBitMap>();
+    // Prepare test data.
+    auto column_bitmap = data_type->create_column();
+    for (int i = 0; i < agg_test_batch_size; i++) {
+        BitmapValue bitmap_value(i);
+        assert_cast<ColumnBitmap&>(*column_bitmap).insert_value(bitmap_value);
+    }
+
+    // Prepare test function and parameters.
+    AggregateFunctionSimpleFactory factory;
+    register_aggregate_function_bitmap(factory);
+    DataTypes data_types = {data_type};
+    auto agg_function = factory.get(function_name, data_types);
+    agg_function->set_version(3);
+    std::unique_ptr<char[]> memory(new char[agg_function->size_of_data()]);
+    AggregateDataPtr place = memory.get();
+    agg_function->create(place);
+
+    // Do aggregation.
+    const IColumn* column[1] = {column_bitmap.get()};

Review Comment:
   warning: do not declare C-style arrays, use std::array<> instead 
[modernize-avoid-c-arrays]
   ```cpp
       const IColumn* column[1] = {column_bitmap.get()};
             ^
   ```
   



##########
be/src/util/bitmap_value.h:
##########
@@ -1172,10 +1172,11 @@ class BitmapValue {
     using SetContainer = phmap::flat_hash_set<T>;
 
     // Construct an empty bitmap.
-    BitmapValue() : _type(EMPTY), _is_shared(false) {}
+    BitmapValue() : _sv(0), _bitmap(nullptr), _type(EMPTY), _is_shared(false) 
{ _set.clear(); }

Review Comment:
   warning: member initializer for '_sv' is redundant 
[modernize-use-default-member-init]
   
   ```suggestion
       BitmapValue() : , _bitmap(nullptr), _type(EMPTY), _is_shared(false) { 
_set.clear(); }
   ```
   



##########
be/src/util/bitmap_value.h:
##########
@@ -1172,10 +1172,11 @@
     using SetContainer = phmap::flat_hash_set<T>;
 
     // Construct an empty bitmap.
-    BitmapValue() : _type(EMPTY), _is_shared(false) {}
+    BitmapValue() : _sv(0), _bitmap(nullptr), _type(EMPTY), _is_shared(false) 
{ _set.clear(); }

Review Comment:
   warning: member initializer for '_type' is redundant 
[modernize-use-default-member-init]
   
   ```suggestion
       BitmapValue() : _sv(0), _bitmap(nullptr), , _is_shared(false) { 
_set.clear(); }
   ```
   



##########
be/test/vec/aggregate_functions/agg_bitmap_test.cpp:
##########
@@ -0,0 +1,92 @@
+// 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.
+
+#include <glog/logging.h>
+#include <gtest/gtest-message.h>
+#include <gtest/gtest-param-test.h>
+#include <gtest/gtest-test-part.h>
+#include <stddef.h>
+
+#include <memory>
+#include <string>
+#include <vector>
+
+#include "gtest/gtest_pred_impl.h"
+#include "util/bitmap_value.h"
+#include "vec/aggregate_functions/aggregate_function.h"
+#include "vec/aggregate_functions/aggregate_function_simple_factory.h"
+#include "vec/columns/column.h"
+#include "vec/columns/column_complex.h"
+#include "vec/columns/column_string.h"
+#include "vec/columns/column_vector.h"
+#include "vec/columns/columns_number.h"
+#include "vec/common/string_ref.h"
+#include "vec/core/field.h"
+#include "vec/core/types.h"
+#include "vec/data_types/data_type_bitmap.h"
+#include "vec/data_types/data_type_decimal.h"
+#include "vec/data_types/data_type_number.h"
+#include "vec/data_types/data_type_string.h"
+
+const int agg_test_batch_size = 10;
+
+namespace doris::vectorized {
+// declare function
+void register_aggregate_function_bitmap(AggregateFunctionSimpleFactory& 
factory);
+
+TEST(AggBitmapTest, bitmap_union_test) {

Review Comment:
   warning: all parameters should be named in a function 
[readability-named-parameter]
   
   ```suggestion
   TEST(AggBitmapTest /*unused*/, bitmap_union_test /*unused*/) {
   ```
   



##########
be/test/vec/aggregate_functions/agg_bitmap_test.cpp:
##########
@@ -0,0 +1,92 @@
+// 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.
+
+#include <glog/logging.h>
+#include <gtest/gtest-message.h>
+#include <gtest/gtest-param-test.h>
+#include <gtest/gtest-test-part.h>
+#include <stddef.h>

Review Comment:
   warning: inclusion of deprecated C++ header 'stddef.h'; consider using 
'cstddef' instead [modernize-deprecated-headers]
   
   ```suggestion
   #include <cstddef>
   ```
   



-- 
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