1#pragma once
2
3#include <Formats/FormatSettings.h>
4#include <Processors/Formats/Impl/TabSeparatedRowOutputFormat.h>
5
6
7namespace DB
8{
9
10/** A stream for outputting data in tsv format, but without escaping individual values.
11 * (That is, the output is irreversible.)
12 */
13class TabSeparatedRawRowOutputFormat : public TabSeparatedRowOutputFormat
14{
15public:
16 TabSeparatedRawRowOutputFormat(
17 WriteBuffer & out_,
18 const Block & header_,
19 bool with_names_,
20 bool with_types_,
21 FormatFactory::WriteCallback callback,
22 const FormatSettings & format_settings_)
23 : TabSeparatedRowOutputFormat(out_, header_, with_names_, with_types_, callback, format_settings_)
24 {
25 }
26
27 String getName() const override { return "TabSeparatedRawRowOutputFormat"; }
28
29 void writeField(const IColumn & column, const IDataType & type, size_t row_num) override
30 {
31 type.serializeAsText(column, row_num, out, format_settings);
32 }
33};
34
35}
36