You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "ZhangYu0123 (via GitHub)" <gi...@apache.org> on 2023/03/23 00:25:35 UTC

[GitHub] [doris] ZhangYu0123 commented on a diff in pull request #18028: [vectorized](function) support array_repeat function to be compatible with hive syntax

ZhangYu0123 commented on code in PR #18028:
URL: https://github.com/apache/doris/pull/18028#discussion_r1145547509


##########
be/src/vec/functions/array/function_array_with_constant.cpp:
##########
@@ -79,8 +85,29 @@ class FunctionArrayWithConstant : public IFunction {
     }
 };
 
+struct NameArrayWithConstant {
+    static constexpr auto name = "array_with_constant";
+
+    static void get_param_position_from_arguments(const ColumnNumbers& arguments, size_t& num_position,
+                                                  size_t& value_position) {
+        num_position = arguments[0];
+        value_position = arguments[1];
+    }
+};
+
+struct NameArrayRepeat {
+    static constexpr auto name = "array_repeat";
+
+    static void get_param_position_from_arguments(const ColumnNumbers& arguments, size_t& num_position,
+                                                  size_t& value_position) {
+        value_position = arguments[0];
+        num_position = arguments[1];
+    }
+};
+
 void register_function_array_with_constant(SimpleFunctionFactory& factory) {

Review Comment:
   > better use the `register_alias` to do the work
   
   register_alias cannot change param position. 
   array_with_constant(n, T) 
   array_repeat(T, n) 
   



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