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

yiguolei 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 868884145cd [Opt](expr) Opt decimal comparsion expr. (#28551)
868884145cd is described below

commit 868884145cdba87eebccf0c06dd7c0d786e885dc
Author: Qi Chen <[email protected]>
AuthorDate: Mon Dec 18 18:56:31 2023 +0800

    [Opt](expr) Opt decimal comparsion expr. (#28551)
---
 be/src/vec/core/decimal_comparison.h | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/be/src/vec/core/decimal_comparison.h 
b/be/src/vec/core/decimal_comparison.h
index 46c6f729ca1..a24b85bc7fd 100644
--- a/be/src/vec/core/decimal_comparison.h
+++ b/be/src/vec/core/decimal_comparison.h
@@ -189,8 +189,6 @@ private:
 
     template <bool scale_left, bool scale_right>
     static ColumnPtr apply(const ColumnPtr& c0, const ColumnPtr& c1, 
CompareInt scale) {
-        auto c_res = ColumnUInt8::create();
-
         if constexpr (_actual) {
             bool c0_is_const = is_column_const(*c0);
             bool c1_is_const = is_column_const(*c1);
@@ -205,8 +203,8 @@ private:
                 return DataTypeUInt8().create_column_const(c0->size(), 
to_field(res));
             }
 
+            auto c_res = ColumnUInt8::create(c0->size());
             ColumnUInt8::Container& vec_res = c_res->get_data();
-            vec_res.resize(c0->size());
 
             if (c0_is_const) {
                 const ColumnConst* c0_const = 
check_and_get_column_const<ColVecA>(c0.get());
@@ -236,13 +234,14 @@ private:
                     LOG(FATAL) << "Wrong column in Decimal comparison";
                 }
             }
+            return c_res;
+        } else {
+            return ColumnUInt8::create();
         }
-
-        return c_res;
     }
 
     template <bool scale_left, bool scale_right>
-    static NO_INLINE UInt8 apply(A a, B b, CompareInt scale [[maybe_unused]]) {
+    static UInt8 apply(A a, B b, CompareInt scale [[maybe_unused]]) {
         CompareInt x = a;
         CompareInt y = b;
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to