From cc09bb55576a48f2939b58a3cef8767a475ae49d Mon Sep 17 00:00:00 2001 From: Nikolai Kochetov Date: Tue, 14 May 2019 16:13:12 +0300 Subject: [PATCH] Fix distinct. --- dbms/src/Processors/QueryPipeline.cpp | 2 +- dbms/src/Processors/QueryPipeline.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dbms/src/Processors/QueryPipeline.cpp b/dbms/src/Processors/QueryPipeline.cpp index 4d18948e022..e9d9f6ffb19 100644 --- a/dbms/src/Processors/QueryPipeline.cpp +++ b/dbms/src/Processors/QueryPipeline.cpp @@ -255,7 +255,7 @@ void QueryPipeline::resize(size_t num_streams) if (num_streams == getNumStreams()) return; - has_mixed_streams = true; + has_resize = true; auto resize = std::make_shared(current_header, getNumStreams(), num_streams); auto stream = streams.begin(); diff --git a/dbms/src/Processors/QueryPipeline.h b/dbms/src/Processors/QueryPipeline.h index ea2986d31f4..e932360971a 100644 --- a/dbms/src/Processors/QueryPipeline.h +++ b/dbms/src/Processors/QueryPipeline.h @@ -56,7 +56,7 @@ public: void addDelayedStream(ProcessorPtr source); bool hasDelayedStream() const { return delayed_stream_port; } /// Check if resize transform was used. (In that case another distinct transform will be added). - bool hasMixedStreams() const { return has_mixed_streams; } + bool hasMixedStreams() const { return has_resize || hasMoreThanOneStream(); } void resize(size_t num_streams); @@ -97,7 +97,7 @@ private: OutputPort * delayed_stream_port = nullptr; /// If resize processor was added to pipeline. - bool has_mixed_streams = false; + bool has_resize = false; /// Common header for each stream. Block current_header;