1 | #include <Common/Exception.h> |
---|---|
2 | #include <Core/Block.h> |
3 | #include <Formats/IRowOutputStream.h> |
4 | |
5 | |
6 | namespace DB |
7 | { |
8 | namespace ErrorCodes |
9 | { |
10 | extern const int NOT_IMPLEMENTED; |
11 | } |
12 | |
13 | |
14 | void IRowOutputStream::write(const Block & block, size_t row_num) |
15 | { |
16 | size_t columns = block.columns(); |
17 | |
18 | writeRowStartDelimiter(); |
19 | |
20 | for (size_t i = 0; i < columns; ++i) |
21 | { |
22 | if (i != 0) |
23 | writeFieldDelimiter(); |
24 | |
25 | auto & col = block.getByPosition(i); |
26 | writeField(*col.column, *col.type, row_num); |
27 | } |
28 | |
29 | writeRowEndDelimiter(); |
30 | } |
31 | |
32 | void IRowOutputStream::writeField(const IColumn &, const IDataType &, size_t) |
33 | { |
34 | throw Exception("Method writeField is not implemented for output format", ErrorCodes::NOT_IMPLEMENTED); |
35 | } |
36 | |
37 | } |
38 |