2011-10-24 12:10:59 +00:00
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <DB/DataStreams/IBlockOutputStream.h>
|
|
|
|
|
#include <DB/DataStreams/IRowOutputStream.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
/** Преобразует поток для записи данных по строкам в поток для записи данных по блокам.
|
|
|
|
|
* Наример, для записи текстового дампа.
|
|
|
|
|
*/
|
|
|
|
|
class BlockOutputStreamFromRowOutputStream : public IBlockOutputStream
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
BlockOutputStreamFromRowOutputStream(RowOutputStreamPtr row_output_);
|
|
|
|
|
void write(const Block & block);
|
2011-11-06 06:22:52 +00:00
|
|
|
|
void writePrefix() { row_output->writePrefix(); }
|
|
|
|
|
void writeSuffix() { row_output->writeSuffix(); }
|
2013-05-22 14:57:43 +00:00
|
|
|
|
|
|
|
|
|
void setRowsBeforeLimit(size_t rows_before_limit);
|
2013-09-01 04:55:41 +00:00
|
|
|
|
void setTotals(const Block & totals);
|
2013-09-07 02:03:13 +00:00
|
|
|
|
void setExtremes(const Block & extremes);
|
2011-10-24 12:10:59 +00:00
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
RowOutputStreamPtr row_output;
|
2012-05-08 11:38:00 +00:00
|
|
|
|
bool first_row;
|
2011-10-24 12:10:59 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|