2021-07-29 14:39:42 +00:00
|
|
|
#include <Core/Block.h>
|
2021-10-15 20:18:20 +00:00
|
|
|
#include <Formats/formatBlock.h>
|
2021-10-11 16:11:50 +00:00
|
|
|
#include <Processors/Formats/IOutputFormat.h>
|
|
|
|
#include <Processors/Sources/SourceFromSingleChunk.h>
|
2021-10-16 14:03:50 +00:00
|
|
|
#include <QueryPipeline/QueryPipeline.h>
|
2021-10-11 16:11:50 +00:00
|
|
|
#include <Processors/Executors/CompletedPipelineExecutor.h>
|
2021-07-29 14:39:42 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
2021-08-25 19:30:22 +00:00
|
|
|
|
2021-10-11 16:11:50 +00:00
|
|
|
void formatBlock(OutputFormatPtr out, const Block & block)
|
2021-07-29 14:39:42 +00:00
|
|
|
{
|
2021-10-11 16:11:50 +00:00
|
|
|
auto source = std::make_shared<SourceFromSingleChunk>(block);
|
|
|
|
QueryPipeline pipeline(source);
|
|
|
|
pipeline.complete(out);
|
|
|
|
CompletedPipelineExecutor executor(pipeline);
|
|
|
|
executor.execute();
|
2021-07-29 14:39:42 +00:00
|
|
|
out->flush();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|