diff --git a/src/Storages/MergeTree/MergeTreeData.cpp b/src/Storages/MergeTree/MergeTreeData.cpp index 61c37e21d04..2c76771432f 100644 --- a/src/Storages/MergeTree/MergeTreeData.cpp +++ b/src/Storages/MergeTree/MergeTreeData.cpp @@ -6647,6 +6647,7 @@ MergeTreeData::CurrentlyMovingPartsTagger::CurrentlyMovingPartsTagger(MergeTreeM moving_part.moves_list_entry = data.getContext()->getMovesList().insert( data.getStorageID(), moving_part.part->name, + moving_part.reserved_space->getDisk()->getName(), moving_part.reserved_space->getDisk()->getPath(), moving_part.part->getBytesOnDisk()); } diff --git a/src/Storages/MergeTree/MovesList.cpp b/src/Storages/MergeTree/MovesList.cpp index 4ed37d45ed1..fda8b22f608 100644 --- a/src/Storages/MergeTree/MovesList.cpp +++ b/src/Storages/MergeTree/MovesList.cpp @@ -8,10 +8,12 @@ namespace DB MovesListElement::MovesListElement( const StorageID & table_id_, const std::string & partition_id_, + const std::string & target_disk_name_, const std::string & target_disk_path_, UInt64 part_size_) : table_id(table_id_) , partition_id(partition_id_) + , target_disk_name(target_disk_name_) , target_disk_path(target_disk_path_) , part_size(part_size_) , thread_id(getThreadId()) @@ -24,6 +26,7 @@ MoveInfo MovesListElement::getInfo() const res.database = table_id.database_name; res.table = table_id.table_name; res.partition_id = partition_id; + res.target_disk_name = target_disk_name; res.target_disk_path = target_disk_path; res.part_size = part_size; res.elapsed = watch.elapsedSeconds(); diff --git a/src/Storages/MergeTree/MovesList.h b/src/Storages/MergeTree/MovesList.h index 409829ae640..b5df6ee04b1 100644 --- a/src/Storages/MergeTree/MovesList.h +++ b/src/Storages/MergeTree/MovesList.h @@ -19,6 +19,7 @@ struct MoveInfo std::string database; std::string table; std::string partition_id; + std::string target_disk_name; std::string target_disk_path; UInt64 part_size; @@ -30,6 +31,7 @@ struct MovesListElement : private boost::noncopyable { const StorageID table_id; const std::string partition_id; + const std::string target_disk_name; const std::string target_disk_path; const UInt64 part_size; @@ -39,6 +41,7 @@ struct MovesListElement : private boost::noncopyable MovesListElement( const StorageID & table_id_, const std::string & partition_id_, + const std::string & target_disk_name_, const std::string & target_disk_path_, UInt64 part_size_); diff --git a/src/Storages/System/StorageSystemMoves.cpp b/src/Storages/System/StorageSystemMoves.cpp index c546ec5520b..dfcddff4b81 100644 --- a/src/Storages/System/StorageSystemMoves.cpp +++ b/src/Storages/System/StorageSystemMoves.cpp @@ -13,8 +13,8 @@ NamesAndTypesList StorageSystemMoves::getNamesAndTypes() {"database", std::make_shared()}, {"table", std::make_shared()}, {"elapsed", std::make_shared()}, - {"result_part_name", std::make_shared()}, - {"result_part_path", std::make_shared()}, + {"target_disk_name", std::make_shared()}, + {"target_disk_path", std::make_shared()}, {"partition_id", std::make_shared()}, {"part_size", std::make_shared()}, {"thread_id", std::make_shared()}, @@ -36,8 +36,8 @@ void StorageSystemMoves::fillData(MutableColumns & res_columns, ContextPtr conte res_columns[i++]->insert(move.database); res_columns[i++]->insert(move.table); res_columns[i++]->insert(move.elapsed); - res_columns[i++]->insert(move.result_part_name); - res_columns[i++]->insert(move.result_part_path); + res_columns[i++]->insert(move.target_disk_name); + res_columns[i++]->insert(move.target_disk_path); res_columns[i++]->insert(move.partition_id); res_columns[i++]->insert(move.part_size); res_columns[i++]->insert(move.thread_id); diff --git a/tests/queries/0_stateless/02117_show_create_table_system.reference b/tests/queries/0_stateless/02117_show_create_table_system.reference index 7a0c383b3fb..cef308c9e33 100644 --- a/tests/queries/0_stateless/02117_show_create_table_system.reference +++ b/tests/queries/0_stateless/02117_show_create_table_system.reference @@ -367,6 +367,19 @@ CREATE TABLE system.metrics ) ENGINE = SystemMetrics COMMENT 'SYSTEM TABLE is built on the fly.' +CREATE TABLE system.moves +( + `database` String, + `table` String, + `elapsed` Float64, + `target_disk_name` String, + `target_disk_path` String, + `partition_id` String, + `part_size` UInt64, + `thread_id` UInt64 +) +ENGINE = SystemMoves +COMMENT 'SYSTEM TABLE is built on the fly.' CREATE TABLE system.mutations ( `database` String,