diff --git a/src/Processors/Merges/CollapsingSortedAlgorithm.cpp b/src/Processors/Merges/CollapsingSortedAlgorithm.cpp index a9ee070564c..b1e06cd4541 100644 --- a/src/Processors/Merges/CollapsingSortedAlgorithm.cpp +++ b/src/Processors/Merges/CollapsingSortedAlgorithm.cpp @@ -5,6 +5,8 @@ #include #include +#include + /// Maximum number of messages about incorrect data in the log. #define MAX_ERROR_MESSAGES 10 diff --git a/src/Processors/Merges/CollapsingSortedAlgorithm.h b/src/Processors/Merges/CollapsingSortedAlgorithm.h index 6d6f637c9af..8deacabb9d6 100644 --- a/src/Processors/Merges/CollapsingSortedAlgorithm.h +++ b/src/Processors/Merges/CollapsingSortedAlgorithm.h @@ -24,8 +24,6 @@ public: bool use_average_block_sizes, Logger * log_); - CollapsingSortedAlgorithm(CollapsingSortedAlgorithm &&) = default; - Status merge() override; private: diff --git a/src/Processors/Merges/CollapsingSortedTransform.h b/src/Processors/Merges/CollapsingSortedTransform.h index 3dd052dfcb4..5a9ed16ea2a 100644 --- a/src/Processors/Merges/CollapsingSortedTransform.h +++ b/src/Processors/Merges/CollapsingSortedTransform.h @@ -3,14 +3,6 @@ #include #include -#include -#include -#include -#include -#include - -#include - namespace DB { @@ -38,16 +30,15 @@ public: WriteBuffer * out_row_sources_buf_ = nullptr, bool use_average_block_sizes = false) : IMergingTransform2( - CollapsingSortedAlgorithm( - header, - num_inputs, - std::move(description_), - sign_column, - max_block_size, - out_row_sources_buf_, - use_average_block_sizes, - &Logger::get("CollapsingSortedTransform")), - num_inputs, header, header, true) + num_inputs, header, header, true, + header, + num_inputs, + std::move(description_), + sign_column, + max_block_size, + out_row_sources_buf_, + use_average_block_sizes, + &Logger::get("CollapsingSortedTransform")) { } diff --git a/src/Processors/Merges/IMergingTransform.h b/src/Processors/Merges/IMergingTransform.h index 163188241b9..260f57806a7 100644 --- a/src/Processors/Merges/IMergingTransform.h +++ b/src/Processors/Merges/IMergingTransform.h @@ -116,14 +116,15 @@ template class IMergingTransform2 : public IMergingTransformBase { public: + template IMergingTransform2( - Algorithm && algorithm_, size_t num_inputs, const Block & input_header, const Block & output_header, - bool have_all_inputs_) + bool have_all_inputs_, + Args && ... args) : IMergingTransformBase(num_inputs, input_header, output_header, have_all_inputs_) - , algorithm(std::forward(algorithm_)) + , algorithm(std::forward(args) ...) { } diff --git a/src/Processors/Merges/MergingSortedAlgorithm.cpp b/src/Processors/Merges/MergingSortedAlgorithm.cpp index 7a74a20e9ee..383d8fe90de 100644 --- a/src/Processors/Merges/MergingSortedAlgorithm.cpp +++ b/src/Processors/Merges/MergingSortedAlgorithm.cpp @@ -5,6 +5,11 @@ namespace DB { +namespace ErrorCodes +{ + extern const int LOGICAL_ERROR; +} + MergingSortedAlgorithm::MergingSortedAlgorithm( const Block & header, size_t num_inputs, diff --git a/src/Processors/Merges/MergingSortedAlgorithm.h b/src/Processors/Merges/MergingSortedAlgorithm.h index 17bcdca1ccf..734caec3424 100644 --- a/src/Processors/Merges/MergingSortedAlgorithm.h +++ b/src/Processors/Merges/MergingSortedAlgorithm.h @@ -19,8 +19,6 @@ public: WriteBuffer * out_row_sources_buf_, bool use_average_block_sizes); - MergingSortedAlgorithm(MergingSortedAlgorithm && other) = default; - void addInput(); void initialize(Chunks chunks) override; diff --git a/src/Processors/Merges/MergingSortedTransform.cpp b/src/Processors/Merges/MergingSortedTransform.cpp index 2657077c143..68af48062ba 100644 --- a/src/Processors/Merges/MergingSortedTransform.cpp +++ b/src/Processors/Merges/MergingSortedTransform.cpp @@ -8,11 +8,6 @@ namespace DB { -namespace ErrorCodes -{ - extern const int LOGICAL_ERROR; -} - MergingSortedTransform::MergingSortedTransform( const Block & header, size_t num_inputs, @@ -24,9 +19,14 @@ MergingSortedTransform::MergingSortedTransform( bool use_average_block_sizes, bool have_all_inputs_) : IMergingTransform2( - MergingSortedAlgorithm(header, num_inputs, std::move(description_), max_block_size, - limit_, out_row_sources_buf_, use_average_block_sizes), - num_inputs, header, header, have_all_inputs_) + num_inputs, header, header, have_all_inputs_, + header, + num_inputs, + std::move(description_), + max_block_size, + limit_, + out_row_sources_buf_, + use_average_block_sizes) , quiet(quiet_) { }