From bbf044f4773547d40401838a7e8112f674ae96cc Mon Sep 17 00:00:00 2001 From: alesapin Date: Tue, 7 Feb 2023 22:30:38 +0100 Subject: [PATCH] Fxi --- src/Storages/MergeTree/MutateTask.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/Storages/MergeTree/MutateTask.cpp b/src/Storages/MergeTree/MutateTask.cpp index 16ddcaae89e..5738a48783d 100644 --- a/src/Storages/MergeTree/MutateTask.cpp +++ b/src/Storages/MergeTree/MutateTask.cpp @@ -114,6 +114,12 @@ static void splitMutationCommands( .column_name = rename_to, }); + for_file_renames.push_back( + { + .type = MutationCommand::Type::RENAME_COLUMN, + .column_name = rename_from, + .rename_to = rename_to + }); part_columns.rename(rename_from, rename_to); } } @@ -615,16 +621,7 @@ static NameToNameVector collectFilesForRenames( NameToNameMap squashed_renames; for (const auto & command : commands_for_removes) { - - std::string result_name; - if (command.type == MutationCommand::Type::DROP_INDEX - || command.type == MutationCommand::Type::DROP_PROJECTION - || command.type == MutationCommand::Type::DROP_COLUMN - || command.type == MutationCommand::Type::READ_COLUMN) - result_name = ""; - - if (command.type == MutationCommand::RENAME_COLUMN) - result_name = command.rename_to; + std::string result_name = command.rename_to; bool squashed = false; for (const auto & [name_from, name_to] : squashed_renames)