2013-05-15 11:48:00 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Poco/SharedPtr.h>
|
|
|
|
|
|
|
|
#include <DB/Core/Block.h>
|
|
|
|
#include <DB/IO/WriteBuffer.h>
|
|
|
|
#include <DB/IO/WriteBufferValidUTF8.h>
|
|
|
|
#include <DB/DataStreams/JSONRowOutputStream.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2013-05-20 12:21:51 +00:00
|
|
|
/** Поток для вывода данных в формате JSONCompact.
|
2013-05-15 11:48:00 +00:00
|
|
|
*/
|
|
|
|
class JSONCompactRowOutputStream : public JSONRowOutputStream
|
|
|
|
{
|
|
|
|
public:
|
2013-05-22 14:57:43 +00:00
|
|
|
JSONCompactRowOutputStream(WriteBuffer & ostr_, const Block & sample_);
|
2013-05-15 11:48:00 +00:00
|
|
|
|
|
|
|
void writeField(const Field & field);
|
|
|
|
void writeFieldDelimiter();
|
|
|
|
void writeRowStartDelimiter();
|
|
|
|
void writeRowEndDelimiter();
|
2013-09-01 04:55:41 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void writeTotals();
|
2013-09-07 02:03:13 +00:00
|
|
|
void writeExtremes();
|
2013-05-15 11:48:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|