mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Flush output format on each block in executeQuery
This commit is contained in:
parent
61d33a8d9a
commit
cf6bbaeb97
@ -689,19 +689,7 @@ void executeQuery(
|
|||||||
if (set_result_details)
|
if (set_result_details)
|
||||||
set_result_details(context.getClientInfo().current_query_id, out->getContentType(), format_name, DateLUT::instance().getTimeZone());
|
set_result_details(context.getClientInfo().current_query_id, out->getContentType(), format_name, DateLUT::instance().getTimeZone());
|
||||||
|
|
||||||
if (ast->as<ASTWatchQuery>())
|
copyData(*streams.in, *out, [](){ return false; }, [&out](const Block &) { out->flush(); });
|
||||||
{
|
|
||||||
/// For Watch query, flush data if block is empty (to send data to client).
|
|
||||||
auto flush_callback = [&out](const Block & block)
|
|
||||||
{
|
|
||||||
if (block.rows() == 0)
|
|
||||||
out->flush();
|
|
||||||
};
|
|
||||||
|
|
||||||
copyData(*streams.in, *out, [](){ return false; }, std::move(flush_callback));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
copyData(*streams.in, *out);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pipeline.initialized())
|
if (pipeline.initialized())
|
||||||
|
Loading…
Reference in New Issue
Block a user