From 7d382cc7b59d8659e9d28a2bf0b5c0211d51e82c Mon Sep 17 00:00:00 2001 From: alesapin Date: Tue, 19 May 2020 19:03:10 +0300 Subject: [PATCH] Return missed command --- .../MergeTree/MergeTreeDataMergerMutator.cpp | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/Storages/MergeTree/MergeTreeDataMergerMutator.cpp b/src/Storages/MergeTree/MergeTreeDataMergerMutator.cpp index 0c7d749d786..8e6533575f3 100644 --- a/src/Storages/MergeTree/MergeTreeDataMergerMutator.cpp +++ b/src/Storages/MergeTree/MergeTreeDataMergerMutator.cpp @@ -1262,13 +1262,19 @@ void MergeTreeDataMergerMutator::splitMutationCommands( NameSet mutated_columns; for (const auto & command : commands) { - if (command.type == MutationCommand::Type::MATERIALIZE_INDEX || command.type == MutationCommand::Type::MATERIALIZE_TTL - || command.type == MutationCommand::Type::DELETE || command.type == MutationCommand::Type::UPDATE) + if (command.type == MutationCommand::Type::MATERIALIZE_INDEX + || command.type == MutationCommand::Type::MATERIALIZE_TTL + || command.type == MutationCommand::Type::DELETE + || command.type == MutationCommand::Type::UPDATE) { for_interpreter.push_back(command); for (const auto & [column_name, expr] : command.column_to_update_expression) mutated_columns.emplace(column_name); } + else if (command.type == MutationCommand::Type::DROP_INDEX) + { + for_file_renames.push_back(command); + } else if (part_columns.has(command.column_name)) { if (command.type == MutationCommand::Type::DROP_COLUMN) @@ -1277,7 +1283,8 @@ void MergeTreeDataMergerMutator::splitMutationCommands( } else if (command.type == MutationCommand::Type::RENAME_COLUMN) { - for_interpreter.push_back({ + for_interpreter.push_back( + { .type = MutationCommand::Type::READ_COLUMN, .column_name = command.rename_to, }); @@ -1299,11 +1306,17 @@ void MergeTreeDataMergerMutator::splitMutationCommands( { for (const auto & command : commands) { - if (command.type == MutationCommand::Type::MATERIALIZE_INDEX || command.type == MutationCommand::Type::MATERIALIZE_TTL - || command.type == MutationCommand::Type::DELETE || command.type == MutationCommand::Type::UPDATE) + if (command.type == MutationCommand::Type::MATERIALIZE_INDEX + || command.type == MutationCommand::Type::MATERIALIZE_TTL + || command.type == MutationCommand::Type::DELETE + || command.type == MutationCommand::Type::UPDATE) { for_interpreter.push_back(command); } + else if (command.type == MutationCommand::Type::DROP_INDEX) + { + for_file_renames.push_back(command); + } /// If we don't have this column in source part, than we don't need /// to materialize it else if (part_columns.has(command.column_name))