fix merges

Signed-off-by: Jianfei Hu <hujianfei258@gmail.com>
This commit is contained in:
Jianfei Hu 2023-04-20 21:37:50 +00:00
parent 59a81b82bc
commit bd4df60df6
3 changed files with 6 additions and 2 deletions

View File

@ -27,6 +27,7 @@ MergeListElement::MergeListElement(
{
WriteBufferFromOwnString out;
FormatSettings format_settings;
bool partition_initialized = false;
for (const auto & source_part : future_part->parts)
{
source_part_names.emplace_back(source_part->name);
@ -36,7 +37,8 @@ MergeListElement::MergeListElement(
total_size_bytes_uncompressed += source_part->getTotalColumnsSize().data_uncompressed;
total_size_marks += source_part->getMarksCount();
total_rows_count += source_part->index_granularity.getTotalRows();
if (partition.empty()) {
if (partition_initialized) {
partition_initialized = true;
future_part->getPartition().serializeText(source_part->storage, out, format_settings);
partition = out.str();
}
@ -59,6 +61,7 @@ MergeInfo MergeListElement::getInfo() const
res.result_part_name = result_part_name;
res.result_part_path = result_part_path;
res.partition_id = partition_id;
res.partition = partition;
res.is_mutation = is_mutation;
res.elapsed = watch.elapsedSeconds();
res.progress = progress.load(std::memory_order_relaxed);

View File

@ -35,6 +35,7 @@ struct MergeInfo
Array source_part_names;
Array source_part_paths;
std::string partition_id;
std::string partition;
bool is_mutation;
Float64 elapsed;
Float64 progress;

View File

@ -59,7 +59,7 @@ void StorageSystemMerges::fillData(MutableColumns & res_columns, ContextPtr cont
res_columns[i++]->insert(merge.source_part_paths);
res_columns[i++]->insert(merge.result_part_path);
res_columns[i++]->insert(merge.partition_id);
// res_columns[i++]->insert(context->getMergeList().get().;
res_columns[i++]->insert(merge.partition);
res_columns[i++]->insert(merge.is_mutation);
res_columns[i++]->insert(merge.total_size_bytes_compressed);
res_columns[i++]->insert(merge.total_size_bytes_uncompressed);