mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-12 01:12:12 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
38 lines
744 B
C++
38 lines
744 B
C++
#include <Common/Exception.h>
|
|
#include <Core/Block.h>
|
|
#include <Formats/IRowOutputStream.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
namespace ErrorCodes
|
|
{
|
|
extern const int NOT_IMPLEMENTED;
|
|
}
|
|
|
|
|
|
void IRowOutputStream::write(const Block & block, size_t row_num)
|
|
{
|
|
size_t columns = block.columns();
|
|
|
|
writeRowStartDelimiter();
|
|
|
|
for (size_t i = 0; i < columns; ++i)
|
|
{
|
|
if (i != 0)
|
|
writeFieldDelimiter();
|
|
|
|
auto & col = block.getByPosition(i);
|
|
writeField(*col.column, *col.type, row_num);
|
|
}
|
|
|
|
writeRowEndDelimiter();
|
|
}
|
|
|
|
void IRowOutputStream::writeField(const IColumn &, const IDataType &, size_t)
|
|
{
|
|
throw Exception("Method writeField is not implemented for output format", ErrorCodes::NOT_IMPLEMENTED);
|
|
}
|
|
|
|
}
|