From 31c39c8137a7dd7ec3de2edf66666a5b5edc9828 Mon Sep 17 00:00:00 2001 From: CurtizJ Date: Tue, 4 Feb 2020 15:11:32 +0300 Subject: [PATCH] fix mutations --- dbms/src/Storages/MergeTree/IMergeTreeDataPart.h | 1 - dbms/src/Storages/MergeTree/MergeTreeData.h | 9 --------- .../Storages/MergeTree/MergeTreeDataMergerMutator.cpp | 8 +++++--- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/dbms/src/Storages/MergeTree/IMergeTreeDataPart.h b/dbms/src/Storages/MergeTree/IMergeTreeDataPart.h index 54e918f5b49..e4a3621126b 100644 --- a/dbms/src/Storages/MergeTree/IMergeTreeDataPart.h +++ b/dbms/src/Storages/MergeTree/IMergeTreeDataPart.h @@ -71,7 +71,6 @@ public: virtual bool isStoredOnDisk() const = 0; - virtual bool supportsVerticalMerge() const { return false; } /// NOTE: Returns zeros if column files are not found in checksums. diff --git a/dbms/src/Storages/MergeTree/MergeTreeData.h b/dbms/src/Storages/MergeTree/MergeTreeData.h index 8d87edb166a..f633e2ab1ea 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeData.h +++ b/dbms/src/Storages/MergeTree/MergeTreeData.h @@ -942,15 +942,6 @@ protected: void setStoragePolicy(const String & new_storage_policy_name, bool only_check = false); - /// out_rename_map maps column files for the out_expression onto new table files. - /// out_force_update_metadata denotes if metadata must be changed even if out_rename_map is empty (used - /// for transformation-free changing of Enum values list). - /// Files to be deleted are mapped to an empty string in out_rename_map. - /// If part == nullptr, just checks that all type conversions are possible. - // void createConvertExpression(const DataPartPtr & part, const NamesAndTypesList & old_columns, const NamesAndTypesList & new_columns, - // const IndicesASTs & old_indices, const IndicesASTs & new_indices, - // ExpressionActionsPtr & out_expression, NameToNameMap & out_rename_map, bool & out_force_update_metadata) const; - /// Calculates column sizes in compressed form for the current state of data_parts. Call with data_parts mutex locked. void calculateColumnSizesImpl(); /// Adds or subtracts the contribution of the part to compressed column sizes. diff --git a/dbms/src/Storages/MergeTree/MergeTreeDataMergerMutator.cpp b/dbms/src/Storages/MergeTree/MergeTreeDataMergerMutator.cpp index 62b546ff830..6ad04e4e0f2 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeDataMergerMutator.cpp +++ b/dbms/src/Storages/MergeTree/MergeTreeDataMergerMutator.cpp @@ -990,16 +990,18 @@ MergeTreeData::MutableDataPartPtr MergeTreeDataMergerMutator::mutatePartToTempor auto new_data_part = data.createPart( future_part.name, + source_part->getType(), future_part.part_info, space_reservation->getDisk(), - std::move(new_columns), - source_part->bytes_on_disk, - source_part->rows_count, "tmp_mut_" + future_part.name); new_data_part->is_temp = true; new_data_part->ttl_infos = source_part->ttl_infos; + /// It shouldn't be changed by mutation. + new_data_part->index_granularity_info = source_part->index_granularity_info; + new_data_part->setColumns(new_columns); + String new_part_tmp_path = new_data_part->getFullPath(); /// Note: this is done before creating input streams, because otherwise data.data_parts_mutex