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

30 lines
860 B
C++
Raw Normal View History

2019-02-19 18:41:18 +00:00
#pragma once
#include <Formats/FormatSettings.h>
#include <Processors/Formats/Impl/TabSeparatedRowOutputFormat.h>
namespace DB
{
/** The stream for outputting data in the TSKV format.
* TSKV is similar to TabSeparated, but before every value, its name and equal sign are specified: name=value.
* This format is very inefficient.
*/
2022-02-06 04:14:01 +00:00
class TSKVRowOutputFormat final : public TabSeparatedRowOutputFormat
2019-02-19 18:41:18 +00:00
{
public:
TSKVRowOutputFormat(WriteBuffer & out_, const Block & header, const RowOutputFormatParams & params_, const FormatSettings & format_settings);
2019-02-19 18:41:18 +00:00
String getName() const override { return "TSKVRowOutputFormat"; }
2021-11-02 13:40:41 +00:00
private:
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 writeRowEndDelimiter() override;
NamesAndTypes fields;
size_t field_number = 0;
};
}