mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-11 17:02:25 +00:00
37 lines
895 B
C++
37 lines
895 B
C++
#include <DataStreams/NativeBlockInputStream.h>
|
|
#include <DataStreams/NativeBlockOutputStream.h>
|
|
#include <Formats/FormatFactory.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
void registerInputFormatNative(FormatFactory & factory)
|
|
{
|
|
factory.registerInputFormat("Native", [](
|
|
ReadBuffer & buf,
|
|
const Block & sample,
|
|
const Context &,
|
|
UInt64 /* max_block_size */,
|
|
UInt64 /* min_read_rows */,
|
|
FormatFactory::ReadCallback /* callback */,
|
|
const FormatSettings &)
|
|
{
|
|
return std::make_shared<NativeBlockInputStream>(buf, sample, 0);
|
|
});
|
|
}
|
|
|
|
void registerOutputFormatNative(FormatFactory & factory)
|
|
{
|
|
factory.registerOutputFormat("Native", [](
|
|
WriteBuffer & buf,
|
|
const Block & sample,
|
|
const Context &,
|
|
const FormatSettings &)
|
|
{
|
|
return std::make_shared<NativeBlockOutputStream>(buf, 0, sample);
|
|
});
|
|
}
|
|
|
|
}
|