2018-06-10 19:22:49 +00:00
|
|
|
#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 &,
|
2019-05-14 15:52:03 +00:00
|
|
|
UInt64 /* max_block_size */,
|
|
|
|
UInt64 /* min_read_rows */,
|
2019-05-23 13:20:25 +00:00
|
|
|
FormatFactory::ReadCallback /* callback */,
|
2018-06-10 19:22:49 +00:00
|
|
|
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);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|