add readPrefix()/readSuffix() calls for completeness #2084 [#CLICKHOUSE-3540]

This commit is contained in:
Alex Zatelepin 2018-03-27 22:25:50 +00:00
parent 88a9b7de91
commit 1be7c09702

View File

@ -74,8 +74,13 @@ void PushingToViewsBlockOutputStream::write(const Block & block)
BlockInputStreamPtr from = std::make_shared<OneBlockInputStream>(block);
InterpreterSelectQuery select(view.query, *views_context, {}, QueryProcessingStage::Complete, 0, from);
BlockInputStreamPtr data = std::make_shared<MaterializingBlockInputStream>(select.execute().in);
data->readPrefix();
while (Block result_block = data->read())
view.out->write(result_block);
data->readSuffix();
}
catch (Exception & ex)
{