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

panxiaolei 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 1d0690bf0f3 [Enchancement](column) make create_always_true_column 
return column const (#39086)
1d0690bf0f3 is described below

commit 1d0690bf0f3ce9bf0211c9cee97391de8577a3da
Author: Pxl <pxl...@qq.com>
AuthorDate: Tue Sep 10 15:20:20 2024 +0800

    [Enchancement](column) make create_always_true_column return column const 
(#39086)
    
    ## Proposed changes
    make create_always_true_column return column const
---
 be/src/vec/utils/util.hpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/be/src/vec/utils/util.hpp b/be/src/vec/utils/util.hpp
index 3c5f4f194aa..8d17b2787a5 100644
--- a/be/src/vec/utils/util.hpp
+++ b/be/src/vec/utils/util.hpp
@@ -173,12 +173,12 @@ inline std::string remove_suffix(const std::string& name, 
const std::string& suf
 };
 
 inline ColumnPtr create_always_true_column(size_t size, bool is_nullable) {
-    auto res_data_column = ColumnUInt8::create(size, 1);
+    ColumnPtr res_data_column = ColumnUInt8::create(1, 1);
     if (is_nullable) {
-        auto null_map = ColumnVector<UInt8>::create(size, 0);
-        return ColumnNullable::create(std::move(res_data_column), 
std::move(null_map));
+        auto null_map = ColumnVector<UInt8>::create(1, 0);
+        res_data_column = ColumnNullable::create(res_data_column, 
std::move(null_map));
     }
-    return res_data_column;
+    return ColumnConst::create(std::move(res_data_column), size);
 }
 
 // change null element to true element


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

Reply via email to