diff --git a/dbms/src/Storages/MergeTree/MergeTreeDataMergerMutator.cpp b/dbms/src/Storages/MergeTree/MergeTreeDataMergerMutator.cpp index 71251669da6..90b3db0e8ea 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeDataMergerMutator.cpp +++ b/dbms/src/Storages/MergeTree/MergeTreeDataMergerMutator.cpp @@ -1533,11 +1533,12 @@ void MergeTreeDataMergerMutator::finalizeMutatedPart( MergeTreeData::MutableDataPartPtr new_data_part, bool need_remove_expired_values) const { + auto disk = new_data_part->disk; if (need_remove_expired_values) { /// Write a file with ttl infos in json format. - WriteBufferFromFile out_ttl(new_data_part->getFullPath() + "ttl.txt", 4096); - HashingWriteBuffer out_hashing(out_ttl); + auto out_ttl = disk->writeFile(new_data_part->getFullPath() + "ttl.txt", 4096); + HashingWriteBuffer out_hashing(*out_ttl); new_data_part->ttl_infos.write(out_hashing); new_data_part->checksums.files["ttl.txt"].file_size = out_hashing.count(); new_data_part->checksums.files["ttl.txt"].file_hash = out_hashing.getHash(); @@ -1545,15 +1546,15 @@ void MergeTreeDataMergerMutator::finalizeMutatedPart( { /// Write file with checksums. - WriteBufferFromFile out_checksums(new_data_part->getFullPath() + "checksums.txt", 4096); - new_data_part->checksums.write(out_checksums); + auto out_checksums = disk->writeFile(new_data_part->getFullPath() + "checksums.txt", 4096); + new_data_part->checksums.write(*out_checksums); } /// close fd { /// Write a file with a description of columns. - WriteBufferFromFile out_columns(new_data_part->getFullPath() + "columns.txt", 4096); - new_data_part->getColumns().writeText(out_columns); + auto out_columns = disk->writeFile(new_data_part->getFullPath() + "columns.txt", 4096); + new_data_part->getColumns().writeText(*out_columns); } /// close fd new_data_part->rows_count = source_part->rows_count;