1#pragma once
2
3#include <DataStreams/BlockIO.h>
4
5#include <Processors/QueryPipeline.h>
6
7namespace DB
8{
9
10/** Interpreters interface for different queries.
11 */
12class IInterpreter
13{
14public:
15 /** For queries that return a result (SELECT and similar), sets in BlockIO a stream from which you can read this result.
16 * For queries that receive data (INSERT), sets a thread in BlockIO where you can write data.
17 * For queries that do not require data and return nothing, BlockIO will be empty.
18 */
19 virtual BlockIO execute() = 0;
20
21 virtual QueryPipeline executeWithProcessors() { throw Exception("executeWithProcessors not implemented", ErrorCodes::NOT_IMPLEMENTED); }
22
23 virtual bool canExecuteWithProcessors() const { return false; }
24
25 virtual bool ignoreQuota() const { return false; }
26 virtual bool ignoreLimits() const { return false; }
27
28 virtual ~IInterpreter() {}
29};
30
31}
32