2014-10-13 14:35:40 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <DB/DataStreams/IBlockOutputStream.h>
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
/** Преобразует столбцы-константы в полноценные столбцы ("материализует" их).
|
|
|
|
*/
|
|
|
|
class MaterializingBlockOutputStream : public IBlockOutputStream
|
|
|
|
{
|
|
|
|
public:
|
2016-08-10 19:12:29 +00:00
|
|
|
MaterializingBlockOutputStream(const BlockOutputStreamPtr & output);
|
|
|
|
void write(const Block & block) override;
|
2016-09-11 10:06:34 +00:00
|
|
|
void flush() override;
|
|
|
|
void writePrefix() override;
|
|
|
|
void writeSuffix() override;
|
|
|
|
void setRowsBeforeLimit(size_t rows_before_limit) override;
|
|
|
|
void setTotals(const Block & totals) override;
|
|
|
|
void setExtremes(const Block & extremes) override;
|
|
|
|
String getContentType() const override;
|
2016-02-25 02:37:31 +00:00
|
|
|
|
2016-08-10 19:12:29 +00:00
|
|
|
private:
|
|
|
|
static Block materialize(const Block & original_block);
|
2016-02-25 02:37:31 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
BlockOutputStreamPtr output;
|
2014-10-13 14:35:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|