You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/12/05 10:10:25 UTC

[GitHub] [doris] github-actions[bot] commented on a diff in pull request #14216: [Feature](fuction) Support split_by_char function

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


##########
be/src/vec/functions/function_string.h:
##########
@@ -1351,6 +1352,137 @@ class FunctionSplitPart : public IFunction {
     }
 };
 
+class FunctionSplitByChar : public IFunction {
+public:
+    static constexpr auto name = "split_by_char";
+
+    static FunctionPtr create() { return std::make_shared<FunctionSplitByChar>(); }
+    using NullMapType = PaddedPODArray<UInt8>;
+
+    String get_name() const override { return name; }
+
+    bool is_variadic() const override { return false; }
+
+    size_t get_number_of_arguments() const override { return 2; }
+
+    DataTypePtr get_return_type_impl(const DataTypes& arguments) const override {
+        DCHECK(is_string(arguments[0]))
+                << "first argument for function: " << name << " should be string"
+                << " and arguments[0] is " << arguments[0]->get_name();
+        DCHECK(is_string(arguments[1]))
+                << "second argument for function: " << name << " should be char"
+                << " and arguments[1] is " << arguments[1]->get_name();
+        return std::make_shared<DataTypeArray>(arguments[0]);
+    }
+
+    Status execute_impl(FunctionContext* context, Block& block, const ColumnNumbers& arguments,

Review Comment:
   warning: parameter 'context' is unused [misc-unused-parameters]
   
   ```suggestion
       Status execute_impl(FunctionContext*  /*context*/, Block& block, const ColumnNumbers& arguments,
   ```
   



-- 
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-unsubscribe@doris.apache.org

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


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