From 2398dc954c38cab93e70878287b1a553aac8e366 Mon Sep 17 00:00:00 2001 From: Nikolai Kochetov Date: Fri, 27 Dec 2019 15:46:39 +0300 Subject: [PATCH] Fix SortingAggregatedTransform. --- ...ergingAggregatedMemoryEfficientTransform.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/dbms/src/Processors/Transforms/MergingAggregatedMemoryEfficientTransform.cpp b/dbms/src/Processors/Transforms/MergingAggregatedMemoryEfficientTransform.cpp index d9b5fbc330e..42a94ea0bf9 100644 --- a/dbms/src/Processors/Transforms/MergingAggregatedMemoryEfficientTransform.cpp +++ b/dbms/src/Processors/Transforms/MergingAggregatedMemoryEfficientTransform.cpp @@ -429,21 +429,30 @@ IProcessor::Status SortingAggregatedTransform::prepare() continue; } - all_finished = false; + //all_finished = false; in->setNeeded(); if (!in->hasData()) { need_data = true; + all_finished = false; continue; } auto chunk = in->pull(); - /// If chunk was pulled, then we need data from this port. - need_data = true; - addChunk(std::move(chunk), input_num); + + if (in->isFinished()) + { + is_input_finished[input_num] = true; + } + else + { + /// If chunk was pulled, then we need data from this port. + need_data = true; + all_finished = false; + } } if (pushed_to_output)