zhiqiang-hhhh commented on code in PR #33741:
URL: https://github.com/apache/doris/pull/33741#discussion_r1597342023


##########
be/test/vec/function/function_test_util.h:
##########
@@ -352,4 +357,37 @@ Status check_function(const std::string& func_name, const 
InputTypeSet& input_ty
     return Status::OK();
 }
 
+using BaseInputTypeSet = std::vector<TypeIndex>;
+
+// Each parameter may be decorated with 'const', but each invocation of 
'check_function' can only handle one state of the parameters.
+// If there are 'n' parameters, it would require manually calling 
'check_function' 2^n times, whereas through this function, only one
+// invocation is needed.
+template <typename ReturnType, bool nullable = false>
+void check_function_all_arg_comb(const std::string& func_name, const 
BaseInputTypeSet& base_set,
+                                 const DataSet& data_set) {
+    int arg_cnt = base_set.size();
+    // Consider each parameter as a bit, if the j-th bit is 1, the j-th 
parameter is const; otherwise, it is not.
+    for (int i = 0; i < (1 << arg_cnt); i++) {

Review Comment:
   hard to read



##########
be/test/vec/function/function_test_util.h:
##########
@@ -352,4 +357,37 @@ Status check_function(const std::string& func_name, const 
InputTypeSet& input_ty
     return Status::OK();
 }
 
+using BaseInputTypeSet = std::vector<TypeIndex>;
+
+// Each parameter may be decorated with 'const', but each invocation of 
'check_function' can only handle one state of the parameters.
+// If there are 'n' parameters, it would require manually calling 
'check_function' 2^n times, whereas through this function, only one
+// invocation is needed.
+template <typename ReturnType, bool nullable = false>
+void check_function_all_arg_comb(const std::string& func_name, const 
BaseInputTypeSet& base_set,
+                                 const DataSet& data_set) {
+    int arg_cnt = base_set.size();
+    // Consider each parameter as a bit, if the j-th bit is 1, the j-th 
parameter is const; otherwise, it is not.
+    for (int i = 0; i < (1 << arg_cnt); i++) {
+        InputTypeSet input_types {};
+        for (int j = 0; j < arg_cnt; j++) {
+            if ((1 << j) & i) {

Review Comment:
   hard to read



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