ClickHouse/src/Processors/Formats/Impl/JSONCompactRowOutputFormat.h

48 lines
1.3 KiB
C++
Raw Normal View History

2019-02-19 18:41:18 +00:00
#pragma once
#include <Core/Block.h>
#include <IO/WriteBuffer.h>
#include <IO/WriteBufferValidUTF8.h>
#include <Processors/Formats/Impl/JSONRowOutputFormat.h>
namespace DB
{
struct FormatSettings;
2020-09-02 04:05:02 +00:00
/** The stream for outputting data in the JSONCompact- formats.
2019-02-19 18:41:18 +00:00
*/
class JSONCompactRowOutputFormat : public JSONRowOutputFormat
{
public:
2020-09-02 04:05:02 +00:00
JSONCompactRowOutputFormat(
WriteBuffer & out_,
const Block & header,
const RowOutputFormatParams & params_,
2020-09-02 04:05:02 +00:00
const FormatSettings & settings_,
bool yield_strings_);
2019-02-19 18:41:18 +00:00
String getName() const override { return "JSONCompactRowOutputFormat"; }
2021-03-09 14:46:52 +00:00
void writeField(const IColumn & column, const ISerialization & serialization, size_t row_num) override;
2019-02-19 18:41:18 +00:00
void writeFieldDelimiter() override;
void writeRowStartDelimiter() override;
void writeRowEndDelimiter() override;
void writeBeforeTotals() override;
void writeAfterTotals() override;
protected:
void writeExtremesElement(const char * title, const Columns & columns, size_t row_num) override;
2021-03-09 14:46:52 +00:00
void writeTotalsField(const IColumn & column, const ISerialization & serialization, size_t row_num) override
2019-02-19 18:41:18 +00:00
{
2021-03-09 14:46:52 +00:00
return writeField(column, serialization, row_num);
2019-02-19 18:41:18 +00:00
}
2019-04-12 15:59:51 +00:00
void writeTotalsFieldDelimiter() override;
2019-02-19 18:41:18 +00:00
};
}