Gabriel39 commented on code in PR #20085:
URL: https://github.com/apache/doris/pull/20085#discussion_r1206256537


##########
be/src/vec/functions/array/function_array_intersect.cpp:
##########
@@ -79,8 +76,66 @@ struct IntersectAction {
     }
 };
 
-using FunctionArrayIntersect =
-        FunctionArrayBinary<ArraySetImpl<SetOperation::INTERSECT>, 
NameArrayIntersect>;
+class FunctionArrayIntersect : public IFunction {
+public:
+    static constexpr auto name = "array_intersect";
+    static FunctionPtr create() { return 
std::make_shared<FunctionArrayIntersect>(); }
+
+    /// Get function name.
+    String get_name() const override { return name; }
+
+    bool is_variadic() const override { return true; }
+
+    bool use_default_implementation_for_constants() const override { return 
true; }
+
+    size_t get_number_of_arguments() const override { return 0; }
+
+    DataTypePtr get_return_type_impl(const DataTypes& arguments) const 
override {
+        DCHECK(arguments.size() >= 2)
+                << "function: " << get_name() << ", arguments should not less 
than 2";
+        for (size_t i = 0; i < arguments.size(); ++i) {
+            DCHECK(is_array(arguments[i])) << i << "-th element is not array 
type";

Review Comment:
   Only DCHECK in this loop? Maybe you should use micro NDEBUG to make sure 
this loop will not be executed for release version



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