From 96d070a5baf2847ea35a9587944f73772295afa2 Mon Sep 17 00:00:00 2001 From: Nikolai Kochetov Date: Tue, 5 Oct 2021 16:58:24 +0300 Subject: [PATCH] Fix tests. --- src/Storages/MergeTree/IMergedBlockOutputStream.h | 4 ++++ src/Storages/MergeTree/MergedBlockOutputStream.h | 2 +- src/Storages/MergeTree/MergedColumnOnlyOutputStream.h | 2 +- src/Storages/MergeTree/MutateTask.cpp | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Storages/MergeTree/IMergedBlockOutputStream.h b/src/Storages/MergeTree/IMergedBlockOutputStream.h index 133f0804838..36fbe76cca2 100644 --- a/src/Storages/MergeTree/IMergedBlockOutputStream.h +++ b/src/Storages/MergeTree/IMergedBlockOutputStream.h @@ -15,8 +15,12 @@ public: const MergeTreeDataPartPtr & data_part, const StorageMetadataPtr & metadata_snapshot_); + virtual ~IMergedBlockOutputStream() = default; + using WrittenOffsetColumns = std::set; + virtual void write(const Block & block) = 0; + const MergeTreeIndexGranularity & getIndexGranularity() const { return writer->getIndexGranularity(); diff --git a/src/Storages/MergeTree/MergedBlockOutputStream.h b/src/Storages/MergeTree/MergedBlockOutputStream.h index 3586ac17298..5965331ee81 100644 --- a/src/Storages/MergeTree/MergedBlockOutputStream.h +++ b/src/Storages/MergeTree/MergedBlockOutputStream.h @@ -24,7 +24,7 @@ public: Block getHeader() const { return metadata_snapshot->getSampleBlock(); } /// If the data is pre-sorted. - void write(const Block & block); + void write(const Block & block) override; /** If the data is not sorted, but we have previously calculated the permutation, that will sort it. * This method is used to save RAM, since you do not need to keep two blocks at once - the original one and the sorted one. diff --git a/src/Storages/MergeTree/MergedColumnOnlyOutputStream.h b/src/Storages/MergeTree/MergedColumnOnlyOutputStream.h index 7a146a91331..4b75bc52f72 100644 --- a/src/Storages/MergeTree/MergedColumnOnlyOutputStream.h +++ b/src/Storages/MergeTree/MergedColumnOnlyOutputStream.h @@ -24,7 +24,7 @@ public: const MergeTreeIndexGranularityInfo * index_granularity_info_ = nullptr); Block getHeader() const { return header; } - void write(const Block & block); + void write(const Block & block) override; MergeTreeData::DataPart::Checksums writeSuffixAndGetChecksums(MergeTreeData::MutableDataPartPtr & new_part, MergeTreeData::DataPart::Checksums & all_checksums, bool sync = false); diff --git a/src/Storages/MergeTree/MutateTask.cpp b/src/Storages/MergeTree/MutateTask.cpp index b93075d0ce6..1900b694a8d 100644 --- a/src/Storages/MergeTree/MutateTask.cpp +++ b/src/Storages/MergeTree/MutateTask.cpp @@ -793,6 +793,7 @@ bool PartMergerWriter::mutateOriginalPartAndPrepareProjections() if (ctx->minmax_idx) ctx->minmax_idx->update(block, ctx->data->getMinMaxColumnsNames(ctx->metadata_snapshot->getPartitionKey())); + ctx->out->write(block); for (size_t i = 0, size = ctx->projections_to_build.size(); i < size; ++i) {