mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-01 20:12:02 +00:00
Analyzer support EXPLAIN ESTIMATE
This commit is contained in:
parent
c391527c86
commit
6fb7d44b62
@ -536,11 +536,21 @@ QueryPipeline InterpreterExplainQuery::executeImpl()
|
||||
|
||||
auto settings = checkAndGetSettings<QueryPlanSettings>(ast.getSettings());
|
||||
QueryPlan plan;
|
||||
ContextPtr context;
|
||||
ContextPtr context = getContext();
|
||||
|
||||
if (context->getSettingsRef().allow_experimental_analyzer)
|
||||
{
|
||||
InterpreterSelectQueryAnalyzer interpreter(ast.getExplainedQuery(), getContext(), SelectQueryOptions());
|
||||
plan = std::move(interpreter).extractQueryPlan();
|
||||
context = interpreter.getContext();
|
||||
}
|
||||
else
|
||||
{
|
||||
InterpreterSelectWithUnionQuery interpreter(ast.getExplainedQuery(), getContext(), SelectQueryOptions());
|
||||
interpreter.buildQueryPlan(plan);
|
||||
context = interpreter.getContext();
|
||||
}
|
||||
|
||||
InterpreterSelectWithUnionQuery interpreter(ast.getExplainedQuery(), getContext(), SelectQueryOptions());
|
||||
interpreter.buildQueryPlan(plan);
|
||||
context = interpreter.getContext();
|
||||
// Collect the selected marks, rows, parts during build query pipeline.
|
||||
// Hold on to the returned QueryPipelineBuilderPtr because `plan` may have pointers into
|
||||
// it (through QueryPlanResourceHolder).
|
||||
|
@ -532,9 +532,6 @@ std::optional<QueryProcessingStage::Enum> StorageDistributed::getOptimizedQueryP
|
||||
|
||||
const auto & query_node = query_info.query_tree->as<const QueryNode &>();
|
||||
|
||||
// std::cerr << query_node.dumpTree() << std::endl;
|
||||
// std::cerr << query_info.table_expression->dumpTree() << std::endl;
|
||||
|
||||
auto expr_contains_sharding_key = [&](const ListNode & exprs) -> bool
|
||||
{
|
||||
std::unordered_set<std::string> expr_columns;
|
||||
|
@ -0,0 +1,5 @@
|
||||
-- Tags: distributed
|
||||
|
||||
SET allow_experimental_analyzer = 1;
|
||||
|
||||
EXPLAIN ESTIMATE SELECT 0 = 1048577, NULL, groupBitmapOr(bitmapBuild([toInt32(65537)])) FROM cluster(test_cluster_two_shards) WHERE NULL = 1048575;
|
Loading…
Reference in New Issue
Block a user