mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-01 20:12:02 +00:00
22 lines
563 B
C++
22 lines
563 B
C++
#include <Core/Block.h>
|
|
#include <Formats/formatBlock.h>
|
|
#include <Processors/Formats/IOutputFormat.h>
|
|
#include <Processors/Sources/SourceFromSingleChunk.h>
|
|
#include <QueryPipeline/QueryPipeline.h>
|
|
#include <Processors/Executors/CompletedPipelineExecutor.h>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
void formatBlock(OutputFormatPtr out, const Block & block)
|
|
{
|
|
auto source = std::make_shared<SourceFromSingleChunk>(block);
|
|
QueryPipeline pipeline(source);
|
|
pipeline.complete(out);
|
|
CompletedPipelineExecutor executor(pipeline);
|
|
executor.execute();
|
|
out->flush();
|
|
}
|
|
|
|
}
|