Yukang-Lian commented on code in PR #13737:
URL: https://github.com/apache/doris/pull/13737#discussion_r1007547644


##########
be/src/vec/functions/function_running_difference.cpp:
##########
@@ -0,0 +1,13 @@
+#include "vec/functions/function_running_difference.h"
+
+namespace doris::vectorized {
+
+void register_function_running_difference(SimpleFunctionFactory& factory) {
+    //factory.register_function<FunctionRunningDifferenceImpl<false>>();
+    factory.register_function<FunctionRunningDifference>();
+    //factory.register_function<FunctionCase<false, true>>();
+    //factory.register_function<FunctionCase<true, false>>();
+    //factory.register_function<FunctionCase<true, true>>();
+}

Review Comment:
   plz remove redundant code.



##########
gensrc/script/doris_builtins_functions.py:
##########
@@ -2180,8 +2180,14 @@
     [['split_part'], 'VARCHAR', ['VARCHAR', 'VARCHAR', 'INT'],
         
'_ZN5doris15StringFunctions10split_partEPN9doris_udf15FunctionContextERKNS1_9StringValES6_RKNS1_6IntValE',
         '', '', 'vec', 'ALWAYS_NULLABLE'],
+
      [['extract_url_parameter'], 'VARCHAR', ['VARCHAR', 'VARCHAR'],'','', '', 
'vec', ''],
 
+    # runningdifference
+    [['running_difference'], 'INT', ['INT'],
+        '',
+        '', '', 'vec', 'ALWAYS_NOT_NULLABLE'],
+

Review Comment:
   we need to register other data types. As follows
   ```suggestion
   [['running_difference'], 'FLOAT', ['FLOAT'],
           '',
           '', '', 'vec', 'ALWAYS_NOT_NULLABLE'],```



##########
be/test/vec/function/function_running_difference_test.cpp:
##########
@@ -0,0 +1,26 @@
+#include <gtest/gtest.h>
+#include <time.h>
+
+#include <any>
+#include <cmath>
+#include <iostream>
+#include <string>
+
+#include "function_test_util.h"
+namespace doris::vectorized {
+    using namespace ut_type;
+    TEST(function_running_test, function_running_difference_test) {
+    std::string func_name = "running_difference"; 
+
+    InputTypeSet input_types = {TypeIndex::Int64};
+
+    DataSet data_set = {
+                        {{(int64_t)1}, (int64_t)0},
+                        {{(int64_t)2}, (int64_t)1},
+                        {{(int64_t)3}, (int64_t)1},
+                        {{(int64_t)5}, (int64_t)2}};
+
+    check_function<DataTypeInt64, true>(func_name, input_types, data_set);
+}
+

Review Comment:
   We need to add more ut to test different data types such as `float` and 
`date`.



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