2022-07-14 11:20:16 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Interpreters/IInterpreter.h>
|
|
|
|
#include <Interpreters/SelectQueryOptions.h>
|
|
|
|
|
|
|
|
#include <Analyzer/QueryTreePassManager.h>
|
|
|
|
#include <Processors/QueryPlan/QueryPlan.h>
|
|
|
|
#include <Interpreters/Context_fwd.h>
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
class InterpreterSelectQueryAnalyzer : public IInterpreter, public WithContext
|
|
|
|
{
|
|
|
|
public:
|
2022-07-18 17:20:28 +00:00
|
|
|
/// Initialize interpreter with query AST
|
2022-07-14 11:20:16 +00:00
|
|
|
InterpreterSelectQueryAnalyzer(
|
2022-07-18 17:20:28 +00:00
|
|
|
const ASTPtr & query_,
|
2022-07-14 11:20:16 +00:00
|
|
|
const SelectQueryOptions & select_query_options_,
|
2022-07-18 17:20:28 +00:00
|
|
|
ContextPtr context_);
|
|
|
|
|
|
|
|
/// Initialize interpreter with query tree after query analysis and others phases
|
|
|
|
InterpreterSelectQueryAnalyzer(
|
|
|
|
const QueryTreeNodePtr & query_tree_,
|
|
|
|
const SelectQueryOptions & select_query_options_,
|
|
|
|
ContextPtr context_);
|
2022-07-14 11:20:16 +00:00
|
|
|
|
|
|
|
Block getSampleBlock();
|
|
|
|
|
|
|
|
BlockIO execute() override;
|
|
|
|
|
|
|
|
bool supportsTransactions() const override { return true; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
void initializeQueryPlanIfNeeded();
|
|
|
|
|
2022-07-18 17:20:28 +00:00
|
|
|
ASTPtr query;
|
|
|
|
QueryTreeNodePtr query_tree;
|
2022-07-14 11:20:16 +00:00
|
|
|
QueryPlan query_plan;
|
|
|
|
SelectQueryOptions select_query_options;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|