Merge pull request #600 from yandex/CLICKHOUSE-2886

Fix Vertical merge in case of OPTIMIZE FINAL with single part.
This commit is contained in:
Vitaliy Lyudvichenko 2017-03-16 18:31:01 +03:00 committed by GitHub
commit 3bdb1b6bb0

View File

@ -24,6 +24,10 @@ ColumnGathererStream::ColumnGathererStream(const BlockInputStreams & source_stre
children.assign(source_streams.begin(), source_streams.end());
/// Trivial case
if (children.size() == 1)
return;
sources.reserve(children.size());
for (size_t i = 0; i < children.size(); i++)
{
@ -150,6 +154,9 @@ void ColumnGathererStream::fetchNewBlock(Source & source, size_t source_num)
void ColumnGathererStream::readSuffixImpl()
{
if (children.size() == 1)
return;
const BlockStreamProfileInfo & profile_info = getProfileInfo();
double seconds = profile_info.total_stopwatch.elapsedSeconds();
LOG_DEBUG(log, std::fixed << std::setprecision(2)