Skip empty totals in SourceFromInputStream.

This commit is contained in:
Nikolai Kochetov 2019-11-05 15:50:47 +03:00
parent abccddb6b9
commit a0e9f9fdcf

View File

@ -115,8 +115,11 @@ Chunk SourceFromInputStream::generate()
if (auto totals_block = stream->getTotals()) if (auto totals_block = stream->getTotals())
{ {
totals.setColumns(totals_block.getColumns(), 1); if (totals_block.rows() == 1) /// Sometimes we can get empty totals. Skip it.
has_totals = true; {
totals.setColumns(totals_block.getColumns(), 1);
has_totals = true;
}
} }
is_stream_finished = true; is_stream_finished = true;