mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-14 18:32:29 +00:00
13482af4ee
- to be replaced by std::string_view - suggested in #39262
39 lines
895 B
C++
39 lines
895 B
C++
#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_)
|
|
{
|
|
}
|
|
|
|
|
|
void RawBLOBRowOutputFormat::writeField(const IColumn & column, const ISerialization &, size_t row_num)
|
|
{
|
|
std::string_view value = column.getDataAt(row_num).toView();
|
|
out.write(value.data(), value.size());
|
|
}
|
|
|
|
|
|
void registerOutputFormatRawBLOB(FormatFactory & factory)
|
|
{
|
|
factory.registerOutputFormat("RawBLOB", [](
|
|
WriteBuffer & buf,
|
|
const Block & sample,
|
|
const RowOutputFormatParams & params,
|
|
const FormatSettings &)
|
|
{
|
|
return std::make_shared<RawBLOBRowOutputFormat>(buf, sample, params);
|
|
});
|
|
}
|
|
|
|
}
|
|
|