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,
|
2019-05-14 15:52:03 +00:00
|
|
|
UInt64 /* max_block_size */,
|
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,
|
2019-08-20 11:17:57 +00:00
|
|
|
FormatFactory::WriteCallback,
|
2018-06-10 19:22:49 +00:00
|
|
|
const FormatSettings &)
|
|
|
|
{
|
|
|
|
return std::make_shared<NativeBlockOutputStream>(buf, 0, sample);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|