ClickHouse/src/Formats/IRowOutputStream.cpp

38 lines
750 B
C++
Raw Normal View History

#include <Common/Exception.h>
#include <Core/Block.h>
#include <Formats/IRowOutputStream.h>
2010-03-04 19:20:28 +00:00
namespace DB
{
namespace ErrorCodes
{
extern const int NOT_IMPLEMENTED;
}
2010-03-04 19:20:28 +00:00
void IRowOutputStream::write(const Block & block, size_t row_num)
2010-03-04 19:20:28 +00:00
{
size_t columns = block.columns();
writeRowStartDelimiter();
2010-03-04 19:20:28 +00:00
for (size_t i = 0; i < columns; ++i)
{
if (i != 0)
writeFieldDelimiter();
2020-04-22 06:34:20 +00:00
const auto & col = block.getByPosition(i);
writeField(*col.column, *col.type, row_num);
}
writeRowEndDelimiter();
2010-03-04 19:20:28 +00:00
}
void IRowOutputStream::writeField(const IColumn &, const IDataType &, size_t)
{
throw Exception("Method writeField is not implemented for output format", ErrorCodes::NOT_IMPLEMENTED);
}
2010-03-04 19:20:28 +00:00
}