This is an automated email from the ASF dual-hosted git repository.

gabriellee pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 82faa965f5 [Bug](followup) fix datev2 functions (#16330)
82faa965f5 is described below

commit 82faa965f5eb9d4fe7f5f883a5e932e0a61a0ee3
Author: Gabriel <gabrielleeb...@gmail.com>
AuthorDate: Wed Feb 1 22:38:34 2023 +0800

    [Bug](followup) fix datev2 functions (#16330)
---
 .../function_date_or_datetime_computation.h        | 36 +++++++++++-----------
 gensrc/script/doris_builtins_functions.py          |  8 -----
 2 files changed, 18 insertions(+), 26 deletions(-)

diff --git a/be/src/vec/functions/function_date_or_datetime_computation.h 
b/be/src/vec/functions/function_date_or_datetime_computation.h
index ff793358c9..ee33e82cf7 100644
--- a/be/src/vec/functions/function_date_or_datetime_computation.h
+++ b/be/src/vec/functions/function_date_or_datetime_computation.h
@@ -311,13 +311,13 @@ struct DateTimeOp {
         size_t size = vec_from0.size();
         vec_to.resize(size);
 
-        bool valid = true;
+        bool invalid = true;
         for (size_t i = 0; i < size; ++i) {
             // here reinterpret_cast is used to convert uint8& to bool&,
             // otherwise it will be implicitly converted to bool, causing the 
rvalue to fail to match the lvalue.
             // the same goes for the following.
-            vec_to[i] = Transform::execute(vec_from0[i], vec_from1[i], valid);
-            DCHECK(valid);
+            vec_to[i] = Transform::execute(vec_from0[i], vec_from1[i], 
invalid);
+            DCHECK(!invalid);
         }
     }
 
@@ -339,10 +339,10 @@ struct DateTimeOp {
         size_t size = vec_from0.size();
         vec_to.resize(size);
 
-        bool valid = true;
+        bool invalid = true;
         for (size_t i = 0; i < size; ++i) {
-            vec_to[i] = Transform::execute(vec_from0[i], vec_from1[i], valid);
-            DCHECK(valid);
+            vec_to[i] = Transform::execute(vec_from0[i], vec_from1[i], 
invalid);
+            DCHECK(!invalid);
         }
     }
 
@@ -363,10 +363,10 @@ struct DateTimeOp {
         size_t size = vec_from.size();
         vec_to.resize(size);
 
-        bool valid = true;
+        bool invalid = true;
         for (size_t i = 0; i < size; ++i) {
-            vec_to[i] = Transform::execute(vec_from[i], delta, valid);
-            DCHECK(valid);
+            vec_to[i] = Transform::execute(vec_from[i], delta, invalid);
+            DCHECK(!invalid);
         }
     }
 
@@ -386,11 +386,11 @@ struct DateTimeOp {
                                 PaddedPODArray<ToType>& vec_to, Int64 delta) {
         size_t size = vec_from.size();
         vec_to.resize(size);
-        bool valid = true;
+        bool invalid = true;
 
         for (size_t i = 0; i < size; ++i) {
-            vec_to[i] = Transform::execute(vec_from[i], delta, valid);
-            DCHECK(valid);
+            vec_to[i] = Transform::execute(vec_from[i], delta, invalid);
+            DCHECK(!invalid);
         }
     }
 
@@ -410,11 +410,11 @@ struct DateTimeOp {
                                 const IColumn& delta) {
         size_t size = delta.size();
         vec_to.resize(size);
-        bool valid = true;
+        bool invalid = true;
 
         for (size_t i = 0; i < size; ++i) {
-            vec_to[i] = Transform::execute(from, delta.get_int(i), valid);
-            DCHECK(valid);
+            vec_to[i] = Transform::execute(from, delta.get_int(i), invalid);
+            DCHECK(!invalid);
         }
     }
 
@@ -432,11 +432,11 @@ struct DateTimeOp {
                                 const PaddedPODArray<FromType2>& delta) {
         size_t size = delta.size();
         vec_to.resize(size);
-        bool valid = true;
+        bool invalid = true;
 
         for (size_t i = 0; i < size; ++i) {
-            vec_to[i] = Transform::execute(from, delta[i], valid);
-            DCHECK(valid);
+            vec_to[i] = Transform::execute(from, delta[i], invalid);
+            DCHECK(!invalid);
         }
     }
 };
diff --git a/gensrc/script/doris_builtins_functions.py 
b/gensrc/script/doris_builtins_functions.py
index 080f01b2ac..26e93be7b5 100644
--- a/gensrc/script/doris_builtins_functions.py
+++ b/gensrc/script/doris_builtins_functions.py
@@ -780,14 +780,6 @@ visible_functions = [
 
     [['convert_tz'], 'DATETIMEV2', ['DATETIMEV2', 'VARCHAR', 'VARCHAR'], 
'ALWAYS_NULLABLE'],
 
-    [['years_diff'], 'BIGINT', ['DATETIMEV2', 'DATETIMEV2'], 
'ALWAYS_NULLABLE'],
-    [['months_diff'], 'BIGINT', ['DATETIMEV2', 'DATETIMEV2'], 
'ALWAYS_NULLABLE'],
-    [['weeks_diff'], 'BIGINT', ['DATETIMEV2', 'DATETIMEV2'], 
'ALWAYS_NULLABLE'],
-    [['days_diff'], 'BIGINT', ['DATETIMEV2', 'DATETIMEV2'], 'ALWAYS_NULLABLE'],
-    [['hours_diff'], 'BIGINT', ['DATETIMEV2', 'DATETIMEV2'], 
'ALWAYS_NULLABLE'],
-    [['minutes_diff'], 'BIGINT', ['DATETIMEV2', 'DATETIMEV2'], 
'ALWAYS_NULLABLE'],
-    [['seconds_diff'], 'BIGINT', ['DATETIMEV2', 'DATETIMEV2'], 
'ALWAYS_NULLABLE'],
-
     [['years_diff'], 'BIGINT', ['DATETIMEV2', 'DATETIMEV2'], ''],
     [['months_diff'], 'BIGINT', ['DATETIMEV2', 'DATETIMEV2'], ''],
     [['weeks_diff'], 'BIGINT', ['DATETIMEV2', 'DATETIMEV2'], ''],


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

Reply via email to