2011-10-30 05:19:41 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <DB/DataStreams/IRowInputStream.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2016-02-16 16:39:39 +00:00
|
|
|
class Block;
|
2016-02-13 06:37:19 +00:00
|
|
|
class Context;
|
2016-02-16 16:39:39 +00:00
|
|
|
class ReadBuffer;
|
2011-10-30 05:19:41 +00:00
|
|
|
|
|
|
|
|
2016-12-08 00:25:52 +00:00
|
|
|
/** Stream to read data in VALUES format (as in INSERT query).
|
2011-10-30 05:19:41 +00:00
|
|
|
*/
|
|
|
|
class ValuesRowInputStream : public IRowInputStream
|
|
|
|
{
|
|
|
|
public:
|
2016-12-08 00:25:52 +00:00
|
|
|
/** Data is parsed using fast, streaming parser.
|
|
|
|
* If interpret_expressions is true, it will, in addition, try to use SQL parser and interpreter
|
|
|
|
* in case when streaming parser could not parse field (this is very slow).
|
|
|
|
*/
|
|
|
|
ValuesRowInputStream(ReadBuffer & istr_, const Context & context_, bool interpret_expressions_);
|
2011-10-30 05:19:41 +00:00
|
|
|
|
2016-02-16 16:39:39 +00:00
|
|
|
bool read(Block & block) override;
|
2011-10-30 05:19:41 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
ReadBuffer & istr;
|
2016-02-13 06:37:19 +00:00
|
|
|
const Context & context;
|
2016-12-08 00:25:52 +00:00
|
|
|
bool interpret_expressions;
|
2011-10-30 05:19:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|