2011-08-15 21:50:08 +00:00
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <DB/DataStreams/IBlockOutputStream.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
/** Пишет данные в 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;
|
|
|
|
|
void flush() override { ostr.next(); }
|
2014-08-14 20:27:41 +00:00
|
|
|
|
|
2011-08-15 21:50:08 +00:00
|
|
|
|
private:
|
|
|
|
|
WriteBuffer & ostr;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|