ClickHouse/src/Formats/formatBlock.cpp
2021-10-16 17:03:50 +03:00

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();
}
}