mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-12 09:22:05 +00:00
495c6e03aa
* Replace all Context references with std::weak_ptr * Fix shared context captured by value * Fix build * Fix Context with named sessions * Fix copy context * Fix gcc build * Merge with master and fix build * Fix gcc-9 build
40 lines
1.1 KiB
C++
40 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <DataStreams/BlockIO.h>
|
|
#include <Interpreters/Context_fwd.h>
|
|
#include <Parsers/IAST_fwd.h>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
struct QueryLogElement;
|
|
|
|
/** Interpreters interface for different queries.
|
|
*/
|
|
class IInterpreter
|
|
{
|
|
public:
|
|
/** 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.
|
|
*/
|
|
virtual BlockIO execute() = 0;
|
|
|
|
virtual bool ignoreQuota() const { return false; }
|
|
virtual bool ignoreLimits() const { return false; }
|
|
|
|
// Fill query log element with query kind, query databases, query tables and query columns.
|
|
void extendQueryLogElem(
|
|
QueryLogElement & elem,
|
|
const ASTPtr & ast,
|
|
ContextPtr context,
|
|
const String & query_database,
|
|
const String & query_table) const;
|
|
|
|
virtual void extendQueryLogElemImpl(QueryLogElement &, const ASTPtr &, ContextPtr) const {}
|
|
|
|
virtual ~IInterpreter() = default;
|
|
};
|
|
|
|
}
|