HappenLee commented on a change in pull request #7640:
URL: https://github.com/apache/incubator-doris/pull/7640#discussion_r779405069



##########
File path: be/src/vec/functions/function_string.h
##########
@@ -201,12 +185,90 @@ class FunctionSubstring : public IFunction {
     }
 };
 
-class FunctionLeft : public FunctionSubstring {
+template <typename Impl>
+class FunctionSubstring : public IFunction {
+public:
+    static constexpr auto name = SubstringUtil::name;
+    String get_name() const override { return name; }
+    static FunctionPtr create() { return 
std::make_shared<FunctionSubstring<Impl>>(); }
+
+    DataTypePtr get_return_type_impl(const DataTypes& arguments) const 
override {
+        return make_nullable(std::make_shared<DataTypeString>());
+    }
+    DataTypes get_variadic_argument_types_impl() const override {
+        return Impl::get_variadic_argument_types();
+    }
+    size_t get_number_of_arguments() const override {
+        return get_variadic_argument_types_impl().size();
+    }
+
+    bool is_variadic() const override { return true; }

Review comment:
       if you set `get_number_of_arguments()`, `is_variadic()` is false. we 
should check the number of argument




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

Reply via email to