2015-06-18 02:11:05 +00:00
|
|
|
#pragma once
|
|
|
|
|
2017-04-01 09:19:00 +00:00
|
|
|
#include <DataStreams/BlockIO.h>
|
2015-06-18 02:11:05 +00:00
|
|
|
|
2019-03-26 18:28:37 +00:00
|
|
|
#include <Processors/QueryPipeline.h>
|
2015-06-18 02:11:05 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
2020-02-25 18:10:48 +00:00
|
|
|
namespace ErrorCodes
|
|
|
|
{
|
|
|
|
extern const int NOT_IMPLEMENTED;
|
|
|
|
}
|
2015-06-18 02:11:05 +00:00
|
|
|
|
2017-06-02 21:37:28 +00:00
|
|
|
/** Interpreters interface for different queries.
|
2015-06-18 02:11:05 +00:00
|
|
|
*/
|
|
|
|
class IInterpreter
|
|
|
|
{
|
|
|
|
public:
|
2017-06-02 21:37:28 +00:00
|
|
|
/** For queries that return a result (SELECT and similar), sets in BlockIO a stream from which you can read this result.
|
|
|
|
* For queries that receive data (INSERT), sets a thread in BlockIO where you can write data.
|
|
|
|
* For queries that do not require data and return nothing, BlockIO will be empty.
|
2017-04-01 07:20:54 +00:00
|
|
|
*/
|
|
|
|
virtual BlockIO execute() = 0;
|
2015-06-18 02:11:05 +00:00
|
|
|
|
2019-03-26 18:28:37 +00:00
|
|
|
virtual QueryPipeline executeWithProcessors() { throw Exception("executeWithProcessors not implemented", ErrorCodes::NOT_IMPLEMENTED); }
|
|
|
|
|
|
|
|
virtual bool canExecuteWithProcessors() const { return false; }
|
|
|
|
|
2019-11-11 01:11:32 +00:00
|
|
|
virtual bool ignoreQuota() const { return false; }
|
|
|
|
virtual bool ignoreLimits() const { return false; }
|
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
virtual ~IInterpreter() {}
|
2015-06-18 02:11:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|