1#include <Processors/Formats/IInputFormat.h>
2#include <IO/ReadBuffer.h>
3
4
5namespace DB
6{
7
8namespace ErrorCodes
9{
10 extern const int LOGICAL_ERROR;
11}
12
13IInputFormat::IInputFormat(Block header, ReadBuffer & in_)
14 : ISource(std::move(header)), in(in_)
15{
16}
17
18void IInputFormat::resetParser()
19{
20 if (in.hasPendingData())
21 throw Exception("Unread data in IInputFormat::resetParser. Most likely it's a bug.", ErrorCodes::LOGICAL_ERROR);
22
23 // those are protected attributes from ISource (I didn't want to propagate resetParser up there)
24 finished = false;
25 got_exception = false;
26
27 getPort().getInputPort().reopen();
28}
29
30}
31