ClickHouse/src/Processors/Formats/Impl/RawBLOBRowOutputFormat.cpp

39 lines
875 B
C++
Raw Normal View History

2020-09-28 00:11:19 +00:00
#include <Processors/Formats/Impl/RawBLOBRowOutputFormat.h>
#include <Formats/FormatFactory.h>
#include <IO/WriteBuffer.h>
namespace DB
{
RawBLOBRowOutputFormat::RawBLOBRowOutputFormat(
WriteBuffer & out_,
const Block & header_,
const RowOutputFormatParams & params_)
: IRowOutputFormat(header_, out_, params_)
2020-09-28 00:11:19 +00:00
{
}
2021-03-09 14:46:52 +00:00
void RawBLOBRowOutputFormat::writeField(const IColumn & column, const ISerialization &, size_t row_num)
2020-09-28 00:11:19 +00:00
{
StringRef value = column.getDataAt(row_num);
out.write(value.data, value.size);
}
2021-10-11 16:11:50 +00:00
void registerOutputFormatRawBLOB(FormatFactory & factory)
2020-09-28 00:11:19 +00:00
{
2021-10-11 16:11:50 +00:00
factory.registerOutputFormat("RawBLOB", [](
2020-09-28 00:11:19 +00:00
WriteBuffer & buf,
const Block & sample,
2020-10-06 14:32:01 +00:00
const RowOutputFormatParams & params,
2020-09-28 00:11:19 +00:00
const FormatSettings &)
{
2020-10-06 14:32:01 +00:00
return std::make_shared<RawBLOBRowOutputFormat>(buf, sample, params);
2020-09-28 00:11:19 +00:00
});
}
}