2018-09-21 15:20:23 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Interpreters/IInterpreter.h>
|
2019-03-11 14:01:45 +00:00
|
|
|
#include <Parsers/IAST_fwd.h>
|
2021-07-09 10:29:45 +00:00
|
|
|
#include <Parsers/ASTExplainQuery.h>
|
2018-09-21 15:20:23 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
/// Returns single row with explain results
|
2021-04-10 23:33:54 +00:00
|
|
|
class InterpreterExplainQuery : public IInterpreter, WithContext
|
2018-09-21 15:20:23 +00:00
|
|
|
{
|
|
|
|
public:
|
2021-04-10 23:33:54 +00:00
|
|
|
InterpreterExplainQuery(const ASTPtr & query_, ContextPtr context_) : WithContext(context_), query(query_) { }
|
2018-09-21 15:20:23 +00:00
|
|
|
|
|
|
|
BlockIO execute() override;
|
|
|
|
|
2021-09-15 19:35:48 +00:00
|
|
|
static Block getSampleBlock(ASTExplainQuery::ExplainKind kind);
|
2018-09-21 15:20:23 +00:00
|
|
|
|
2022-02-14 19:47:17 +00:00
|
|
|
bool supportsTransactions() const override { return true; }
|
|
|
|
|
2018-09-21 15:20:23 +00:00
|
|
|
private:
|
|
|
|
ASTPtr query;
|
|
|
|
|
2021-09-15 19:35:48 +00:00
|
|
|
QueryPipeline executeImpl();
|
2018-09-21 15:20:23 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
}
|