2011-08-15 21:50:08 +00:00
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <DB/DataStreams/IBlockOutputStream.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
|
{
|
|
|
|
|
|
2016-08-13 01:57:35 +00:00
|
|
|
|
class Block;
|
|
|
|
|
class WriteBuffer;
|
|
|
|
|
|
|
|
|
|
|
2011-08-15 21:50:08 +00:00
|
|
|
|
/** Пишет данные в tab-separated файл, но по столбцам, блоками.
|
|
|
|
|
* Блоки разделены двойным переводом строки.
|
|
|
|
|
* На каждой строке блока - данные одного столбца.
|
|
|
|
|
*/
|
|
|
|
|
class TabSeparatedBlockOutputStream : public IBlockOutputStream
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
TabSeparatedBlockOutputStream(WriteBuffer & ostr_) : ostr(ostr_) {}
|
|
|
|
|
|
2014-11-08 23:52:18 +00:00
|
|
|
|
void write(const Block & block) override;
|
2016-08-13 01:57:35 +00:00
|
|
|
|
void flush() override;
|
2014-08-14 20:27:41 +00:00
|
|
|
|
|
2011-08-15 21:50:08 +00:00
|
|
|
|
private:
|
|
|
|
|
WriteBuffer & ostr;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|