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


##########
be/src/vec/aggregate_functions/aggregate_function_group_array_intersect.h:
##########
@@ -0,0 +1,529 @@
+// 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.
+// This file is copied from
+// 
https://github.com/ClickHouse/ClickHouse/blob/master/src/AggregateFunctions/AggregateFunctionGroupArrayIntersect.cpp
+// and modified by Doris
+
+#include <cassert>
+#include <memory>
+
+#include "exprs/hybrid_set.h"
+#include "vec/aggregate_functions/aggregate_function.h"
+#include "vec/aggregate_functions/aggregate_function_simple_factory.h"
+#include "vec/aggregate_functions/factory_helpers.h"
+#include "vec/aggregate_functions/helpers.h"
+#include "vec/columns/column_array.h"
+#include "vec/common/assert_cast.h"
+#include "vec/core/field.h"
+#include "vec/data_types/data_type_array.h"
+#include "vec/data_types/data_type_number.h"
+#include "vec/data_types/data_type_string.h"
+#include "vec/data_types/data_type_time_v2.h"
+#include "vec/io/io_helper.h"
+#include "vec/io/var_int.h"
+
+namespace doris::vectorized {
+class Arena;
+class BufferReadable;
+class BufferWritable;
+} // namespace doris::vectorized
+
+namespace doris::vectorized {
+
+/// Only for changing Numeric type or Date(DateTime)V2 type to PrimitiveType 
so that to inherit HybridSet
+template <typename T>
+constexpr PrimitiveType TypeToPrimitiveType() {
+    if constexpr (std::is_same_v<T, UInt8> || std::is_same_v<T, Int8>) {
+        return TYPE_TINYINT;
+    } else if constexpr (std::is_same_v<T, Int16>) {
+        return TYPE_SMALLINT;
+    } else if constexpr (std::is_same_v<T, Int32>) {
+        return TYPE_INT;
+    } else if constexpr (std::is_same_v<T, Int64>) {
+        return TYPE_BIGINT;
+    } else if constexpr (std::is_same_v<T, Int128>) {
+        return TYPE_LARGEINT;
+    } else if constexpr (std::is_same_v<T, Float32>) {
+        return TYPE_FLOAT;
+    } else if constexpr (std::is_same_v<T, Float64>) {
+        return TYPE_DOUBLE;
+    } else if constexpr (std::is_same_v<T, DateV2>) {
+        return TYPE_DATEV2;
+    } else if constexpr (std::is_same_v<T, DateTimeV2>) {
+        return TYPE_DATETIMEV2;
+    } else {
+        throw Exception(ErrorCode::INVALID_ARGUMENT,
+                        "Only for changing Numeric type or Date(DateTime)V2 
type to PrimitiveType");
+    }
+}
+
+template <typename T>
+class NullableNumericOrDateSet
+        : public HybridSet<TypeToPrimitiveType<T>(), DynamicContainer<typename 
PrimitiveTypeTraits<
+                                                             
TypeToPrimitiveType<T>()>::CppType>> {
+public:
+    NullableNumericOrDateSet() { this->_null_aware = true; }
+
+    void change_contains_null_value(bool target_value) { this->_contains_null 
= target_value; }
+};
+
+template <typename T>
+struct AggregateFunctionGroupArrayIntersectData {
+    using NullableNumericOrDateSetType = NullableNumericOrDateSet<T>;
+    using Set = std::shared_ptr<NullableNumericOrDateSetType>;
+
+    AggregateFunctionGroupArrayIntersectData()

Review Comment:
   warning: use '= default' to define a trivial default constructor 
[modernize-use-equals-default]
   
   be/src/vec/aggregate_functions/aggregate_function_group_array_intersect.h:89:
   ```diff
   -             : value(std::make_shared<NullableStringSet>()) {}
   +             : value(std::make_shared<NullableStringSet>()) = default;
   ```
   



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