Skip to content

Commit

Permalink
fix ut
Browse files Browse the repository at this point in the history
  • Loading branch information
loneylee committed May 11, 2024
1 parent 48476f0 commit 61d8929
Showing 1 changed file with 18 additions and 19 deletions.
37 changes: 18 additions & 19 deletions cpp-ch/local-engine/Storages/Mergetree/SparkMergeTreeWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,25 +235,24 @@ void SparkMergeTreeWriter::finalize()
for (auto merge_tree_data_part : new_parts.unsafeGet())
final_parts.emplace(merge_tree_data_part->name);

// TODO: delete before commit
// if (temp_storage)
// {
// for (const auto & tmp_part : tmp_parts)
// {
// if (final_parts.contains(tmp_part))
// continue;
//
// GlobalThreadPool::instance().scheduleOrThrow(
// [&]() -> void
// {
// for (auto disk : storage->getDisks())
// {
// auto full_path = storage->getFullPathOnDisk(disk);
// disk->removeRecursive(full_path + "/" + tmp_part);
// }
// });
// }
// }
if (!temp_storage)
{
for (const auto & tmp_part : tmp_parts)
{
if (final_parts.contains(tmp_part))
continue;

GlobalThreadPool::instance().scheduleOrThrow(
[&]() -> void
{
for (auto disk : storage->getDisks())
{
auto full_path = storage->getFullPathOnDisk(disk);
disk->removeRecursive(full_path + "/" + tmp_part);
}
});
}
}
}

DB::MergeTreeDataWriter::TemporaryPart SparkMergeTreeWriter::writeTempPartAndFinalize(
Expand Down

0 comments on commit 61d8929

Please sign in to comment.