aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/Processors/Formats/Impl/RawBLOBRowOutputFormat.h
blob: 261103a0f6d8934b233cae587ed7bb012e04eec1 (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
35
36
37
38
39
40
#pragma once

#include <Core/Block.h>
#include <Processors/Formats/IRowOutputFormat.h>


namespace DB
{

class WriteBuffer;


/** This format only allows to output columns of type String
  *  or types that have contiguous representation in memory.
  * They are output as raw bytes without any delimiters or escaping.
  *
  * The difference between RawBLOB and TSVRaw:
  * - data is output in binary, no escaping;
  * - no delimiters between values;
  * - no newline at the end of each value.
  *
  * The difference between RawBLOB and RowBinary:
  * - strings are output without their lengths.
  *
  * If you are output more than one value, the output format is ambiguous and you may not be able to read data back.
  */
class RawBLOBRowOutputFormat final : public IRowOutputFormat
{
public:
    RawBLOBRowOutputFormat(
        WriteBuffer & out_,
        const Block & header_);

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

private:
    void writeField(const IColumn & column, const ISerialization &, size_t row_num) override;
};

}