From 45a49ac0593bcc65741ff9ad5ffdaca4cf5bdd76 Mon Sep 17 00:00:00 2001 From: Pxl Date: Mon, 4 Dec 2023 12:52:50 +0800 Subject: [PATCH] Bug](column) support insert default for ColumnFixedLengthObject #27927 --- .../vec/columns/column_fixed_length_object.h | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/be/src/vec/columns/column_fixed_length_object.h b/be/src/vec/columns/column_fixed_length_object.h index a817a4ae055f7f..d391bcc43f67a8 100644 --- a/be/src/vec/columns/column_fixed_length_object.h +++ b/be/src/vec/columns/column_fixed_length_object.h @@ -38,9 +38,9 @@ class ColumnFixedLengthObject final : public COWHelper; + ColumnFixedLengthObject() = delete; private: - ColumnFixedLengthObject() = delete; ColumnFixedLengthObject(const size_t _item_size_) : _item_size(_item_size_), _item_count(0) {} ColumnFixedLengthObject(const ColumnFixedLengthObject& src) : _item_size(src._item_size), @@ -63,7 +63,7 @@ class ColumnFixedLengthObject final : public COWHelpercreate(_item_size); + auto res = create(_item_size); if (size > 0) { auto& new_col = assert_cast(*res); @@ -110,13 +110,13 @@ class ColumnFixedLengthObject final : public COWHelper(&_data[n * _item_size]), _item_size); + return {reinterpret_cast(&_data[n * _item_size]), _item_size}; } void insert(const Field& x) override { LOG(FATAL) << "insert not supported"; } void insert_range_from(const IColumn& src, size_t start, size_t length) override { - const ColumnFixedLengthObject& src_col = assert_cast(src); + const auto& src_col = assert_cast(src); CHECK_EQ(src_col._item_size, _item_size); if (length == 0) { @@ -137,7 +137,7 @@ class ColumnFixedLengthObject final : public COWHelper(src); + const auto& src_col = assert_cast(src); DCHECK(_item_size == src_col._item_size) << "dst and src should have the same _item_size " << _item_size << " " << src_col._item_size; size_t old_size = size(); @@ -146,10 +146,16 @@ class ColumnFixedLengthObject final : public COWHelper