2020-05-20 18:53:18 +00:00
|
|
|
#pragma once
|
|
|
|
#include <Processors/Formats/IOutputFormat.h>
|
2021-10-15 20:18:20 +00:00
|
|
|
#include <QueryPipeline/ProfileInfo.h>
|
2020-05-20 18:53:18 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2023-06-01 17:00:47 +00:00
|
|
|
class WriteBufferFromPointer;
|
|
|
|
|
2020-05-20 18:53:18 +00:00
|
|
|
/// Output format which is used in PullingPipelineExecutor.
|
|
|
|
class PullingOutputFormat : public IOutputFormat
|
|
|
|
{
|
|
|
|
public:
|
2023-06-01 17:00:47 +00:00
|
|
|
PullingOutputFormat(const Block & header, std::atomic_bool & consume_data_flag_);
|
2020-05-20 18:53:18 +00:00
|
|
|
|
|
|
|
String getName() const override { return "PullingOutputFormat"; }
|
|
|
|
|
|
|
|
Chunk getChunk();
|
|
|
|
Chunk getTotals();
|
|
|
|
Chunk getExtremes();
|
|
|
|
|
2021-10-15 20:18:20 +00:00
|
|
|
ProfileInfo & getProfileInfo() { return info; }
|
2020-05-20 18:53:18 +00:00
|
|
|
|
|
|
|
void setRowsBeforeLimit(size_t rows_before_limit) override;
|
|
|
|
|
2021-09-15 19:35:48 +00:00
|
|
|
bool expectMaterializedColumns() const override { return false; }
|
|
|
|
|
2020-05-20 18:53:18 +00:00
|
|
|
protected:
|
|
|
|
void consume(Chunk chunk) override;
|
|
|
|
void consumeTotals(Chunk chunk) override { totals = std::move(chunk); }
|
|
|
|
void consumeExtremes(Chunk chunk) override { extremes = std::move(chunk); }
|
|
|
|
|
|
|
|
private:
|
|
|
|
Chunk data;
|
|
|
|
Chunk totals;
|
|
|
|
Chunk extremes;
|
|
|
|
|
|
|
|
std::atomic_bool & has_data_flag;
|
|
|
|
|
2021-10-15 20:18:20 +00:00
|
|
|
ProfileInfo info;
|
2020-05-20 18:53:18 +00:00
|
|
|
|
|
|
|
/// Is not used.
|
2023-06-01 17:00:47 +00:00
|
|
|
static WriteBufferFromPointer out;
|
2020-05-20 18:53:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|