mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 16:12:01 +00:00
31 lines
848 B
C++
31 lines
848 B
C++
#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);
|
|
void writePrefix() { row_output->writePrefix(); }
|
|
void writeSuffix() { row_output->writeSuffix(); }
|
|
|
|
void setRowsBeforeLimit(size_t rows_before_limit);
|
|
void setTotals(const Block & totals);
|
|
void setExtremes(const Block & extremes);
|
|
|
|
private:
|
|
RowOutputStreamPtr row_output;
|
|
bool first_row;
|
|
};
|
|
|
|
}
|