You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "HappenLee (via GitHub)" <gi...@apache.org> on 2023/01/29 09:32:12 UTC

[GitHub] [doris] HappenLee commented on a diff in pull request #16159: [datev2](function) make function nullable DEPEND_ON_ARGUMENT

HappenLee commented on code in PR #16159:
URL: https://github.com/apache/doris/pull/16159#discussion_r1089911086


##########
be/src/vec/functions/function_date_or_datetime_computation.h:
##########
@@ -303,6 +305,21 @@ struct DateTimeOp {
                                            reinterpret_cast<bool&>(null_map[i]));
         }
     }
+    static void vector_vector(const PaddedPODArray<FromType1>& vec_from0,
+                              const PaddedPODArray<FromType2>& vec_from1,
+                              PaddedPODArray<ToType>& vec_to) {
+        size_t size = vec_from0.size();
+        vec_to.resize(size);
+
+        bool valid = 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);

Review Comment:
   check the assembly code to make sure the function can SIMD ?



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