fix test + add one more column

This commit is contained in:
serxa 2022-11-18 20:04:11 +00:00
parent a05a1b0133
commit 8e65b799c2
5 changed files with 24 additions and 4 deletions

View File

@ -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());
}

View File

@ -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();

View File

@ -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_);

View File

@ -13,8 +13,8 @@ NamesAndTypesList StorageSystemMoves::getNamesAndTypes()
{"database", std::make_shared<DataTypeString>()},
{"table", std::make_shared<DataTypeString>()},
{"elapsed", std::make_shared<DataTypeFloat64>()},
{"result_part_name", std::make_shared<DataTypeString>()},
{"result_part_path", std::make_shared<DataTypeString>()},
{"target_disk_name", std::make_shared<DataTypeString>()},
{"target_disk_path", std::make_shared<DataTypeString>()},
{"partition_id", std::make_shared<DataTypeString>()},
{"part_size", std::make_shared<DataTypeUInt64>()},
{"thread_id", std::make_shared<DataTypeUInt64>()},
@ -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);

View File

@ -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,