From a847b71611156af796a6fe1166f6a5538f26f2f9 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Mon, 21 Mar 2022 07:03:43 +0300 Subject: [PATCH] Fix SubcolumnsTree declaration Signed-off-by: Azat Khuzhin --- src/Columns/ColumnObject.cpp | 6 +++--- src/Columns/ColumnObject.h | 10 +++++----- src/DataTypes/Serializations/SerializationObject.cpp | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Columns/ColumnObject.cpp b/src/Columns/ColumnObject.cpp index 54439edb93d..64c7a84c263 100644 --- a/src/Columns/ColumnObject.cpp +++ b/src/Columns/ColumnObject.cpp @@ -521,7 +521,7 @@ ColumnObject::ColumnObject(bool is_nullable_) { } -ColumnObject::ColumnObject(SubcolumnsTree && subcolumns_, bool is_nullable_) +ColumnObject::ColumnObject(Subcolumns && subcolumns_, bool is_nullable_) : is_nullable(is_nullable_) , subcolumns(std::move(subcolumns_)) , num_rows(subcolumns.empty() ? 0 : (*subcolumns.begin())->data.size()) @@ -696,7 +696,7 @@ const ColumnObject::Subcolumn & ColumnObject::getSubcolumn(const PathInData & ke ColumnObject::Subcolumn & ColumnObject::getSubcolumn(const PathInData & key) { if (const auto * node = subcolumns.findLeaf(key)) - return const_cast(node)->data; + return const_cast(node)->data; throw Exception(ErrorCodes::ILLEGAL_COLUMN, "There is no subcolumn {} in ColumnObject", key.getPath()); } @@ -794,7 +794,7 @@ bool ColumnObject::isFinalized() const void ColumnObject::finalize() { size_t old_size = size(); - SubcolumnsTree new_subcolumns; + Subcolumns new_subcolumns; for (auto && entry : subcolumns) { const auto & least_common_type = entry->data.getLeastCommonType(); diff --git a/src/Columns/ColumnObject.h b/src/Columns/ColumnObject.h index fe8763f3777..9d61b165042 100644 --- a/src/Columns/ColumnObject.h +++ b/src/Columns/ColumnObject.h @@ -138,20 +138,20 @@ public: size_t num_of_defaults_in_prefix = 0; }; - using SubcolumnsTree = SubcolumnsTree; + using Subcolumns = SubcolumnsTree; private: /// If true then all subcolumns are nullable. const bool is_nullable; - SubcolumnsTree subcolumns; + Subcolumns subcolumns; size_t num_rows; public: static constexpr auto COLUMN_NAME_DUMMY = "_dummy"; explicit ColumnObject(bool is_nullable_); - ColumnObject(SubcolumnsTree && subcolumns_, bool is_nullable_); + ColumnObject(Subcolumns && subcolumns_, bool is_nullable_); /// Checks that all subcolumns have consistent sizes. void checkConsistency() const; @@ -173,8 +173,8 @@ public: /// It cares about consistency of sizes of Nested arrays. void addNestedSubcolumn(const PathInData & key, const FieldInfo & field_info, size_t new_size); - const SubcolumnsTree & getSubcolumns() const { return subcolumns; } - SubcolumnsTree & getSubcolumns() { return subcolumns; } + const Subcolumns & getSubcolumns() const { return subcolumns; } + Subcolumns & getSubcolumns() { return subcolumns; } PathsInData getKeys() const; /// Finalizes all subcolumns. diff --git a/src/DataTypes/Serializations/SerializationObject.cpp b/src/DataTypes/Serializations/SerializationObject.cpp index 60b196092ed..fb8ccd2e5e6 100644 --- a/src/DataTypes/Serializations/SerializationObject.cpp +++ b/src/DataTypes/Serializations/SerializationObject.cpp @@ -63,12 +63,12 @@ private: size_t num_dimensions_to_keep; }; -using Node = typename ColumnObject::SubcolumnsTree::Node; +using Node = typename ColumnObject::Subcolumns::Node; /// Finds a subcolumn from the same Nested type as @entry and inserts /// an array with default values with consistent sizes as in Nested type. bool tryInsertDefaultFromNested( - const std::shared_ptr & entry, const ColumnObject::SubcolumnsTree & subcolumns) + const std::shared_ptr & entry, const ColumnObject::Subcolumns & subcolumns) { if (!entry->path.hasNested()) return false;