Call doWritePrefix() if IOutputFormat works as Processor (i.e. clickhouse-local)

This fixes the *WithNames output format (lack of header before this
patch).
This commit is contained in:
Azat Khuzhin 2020-08-05 00:09:36 +03:00
parent ba92213d21
commit d5a2e1e61c
2 changed files with 8 additions and 0 deletions

View File

@ -46,6 +46,12 @@ IOutputFormat::Status IOutputFormat::prepare()
void IOutputFormat::work()
{
if (!prefix_written)
{
doWritePrefix();
prefix_written = true;
}
if (finished && !finalized)
{
if (rows_before_limit_counter && rows_before_limit_counter->hasAppliedLimit())

View File

@ -87,6 +87,8 @@ private:
/// Counters for consumed chunks. Are used for QueryLog.
size_t result_rows = 0;
size_t result_bytes = 0;
bool prefix_written = false;
};
}