aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/Processors/Formats/Impl/JSONColumnsBlockOutputFormat.h
blob: fa5784d6e1524327b56287d2426c355bb8eb3a64 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#pragma once

#include <Processors/Formats/Impl/JSONColumnsBlockOutputFormatBase.h>

namespace DB
{

/* Format JSONColumns outputs all data as a single block in the next format:
 * {
 *     "name1": [value1, value2, value3, ...],
 *     "name2": [value1, value2, value3, ...],
 *     ...
 * }
 */
class JSONColumnsBlockOutputFormat : public JSONColumnsBlockOutputFormatBase
{
public:
    JSONColumnsBlockOutputFormat(WriteBuffer & out_, const Block & header_, const FormatSettings & format_settings_, bool validate_utf8, size_t indent_ = 0);

    String getName() const override { return "JSONColumnsBlockOutputFormat"; }

protected:
    void writeChunkStart() override;
    void writeChunkEnd() override;

    void writeColumnStart(size_t column_index) override;

    Names names;
    size_t indent;

    Block header;
};

}