2019-11-26 23:46:19 +00:00
|
|
|
#include <Processors/Formats/IInputFormat.h>
|
2019-11-28 23:06:03 +00:00
|
|
|
#include <IO/ReadBuffer.h>
|
2019-11-26 23:46:19 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
IInputFormat::IInputFormat(Block header, ReadBuffer & in_)
|
2021-08-27 03:00:12 +00:00
|
|
|
: ISource(std::move(header)), in(&in_)
|
2019-11-26 23:46:19 +00:00
|
|
|
{
|
2021-03-01 19:58:55 +00:00
|
|
|
column_mapping = std::make_shared<ColumnMapping>();
|
2019-11-26 23:46:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void IInputFormat::resetParser()
|
|
|
|
{
|
2021-08-27 03:00:12 +00:00
|
|
|
in->ignoreAll();
|
2019-12-03 00:49:05 +00:00
|
|
|
// those are protected attributes from ISource (I didn't want to propagate resetParser up there)
|
2019-11-28 16:43:06 +00:00
|
|
|
finished = false;
|
|
|
|
got_exception = false;
|
|
|
|
|
|
|
|
getPort().getInputPort().reopen();
|
2019-11-26 23:46:19 +00:00
|
|
|
}
|
|
|
|
|
2021-08-26 00:31:46 +00:00
|
|
|
void IInputFormat::setReadBuffer(ReadBuffer & in_)
|
|
|
|
{
|
2021-08-27 03:00:12 +00:00
|
|
|
in = &in_;
|
2021-08-26 00:31:46 +00:00
|
|
|
}
|
|
|
|
|
2019-11-26 23:46:19 +00:00
|
|
|
}
|