1#pragma once
2
3#include <Formats/FormatSettings.h>
4#include <Processors/Formats/Impl/TabSeparatedRowOutputFormat.h>
5
6
7namespace DB
8{
9
10/** The stream for outputting data in the TSKV format.
11 * TSKV is similar to TabSeparated, but before every value, its name and equal sign are specified: name=value.
12 * This format is very inefficient.
13 */
14class TSKVRowOutputFormat: public TabSeparatedRowOutputFormat
15{
16public:
17 TSKVRowOutputFormat(WriteBuffer & out_, const Block & header, FormatFactory::WriteCallback callback, const FormatSettings & format_settings);
18
19 String getName() const override { return "TSKVRowOutputFormat"; }
20
21 void writeField(const IColumn & column, const IDataType & type, size_t row_num) override;
22 void writeRowEndDelimiter() override;
23
24protected:
25 NamesAndTypes fields;
26 size_t field_number = 0;
27};
28
29}
30