mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32:02 +00:00
StorageDistributed Planner initialization fix
This commit is contained in:
parent
d3b604de5a
commit
25da9dcef7
@ -959,6 +959,17 @@ Planner::Planner(const QueryTreeNodePtr & query_tree_,
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Planner::Planner(const QueryTreeNodePtr & query_tree_,
|
||||||
|
const SelectQueryOptions & select_query_options_,
|
||||||
|
PlannerContextPtr planner_context_,
|
||||||
|
PlannerConfiguration planner_configuration_)
|
||||||
|
: query_tree(query_tree_)
|
||||||
|
, select_query_options(select_query_options_)
|
||||||
|
, planner_context(std::move(planner_context_))
|
||||||
|
, planner_configuration(std::move(planner_configuration_))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
void Planner::buildQueryPlanIfNeeded()
|
void Planner::buildQueryPlanIfNeeded()
|
||||||
{
|
{
|
||||||
if (query_plan.isInitialized())
|
if (query_plan.isInitialized())
|
||||||
|
@ -35,6 +35,12 @@ public:
|
|||||||
GlobalPlannerContextPtr global_planner_context_,
|
GlobalPlannerContextPtr global_planner_context_,
|
||||||
PlannerConfiguration planner_configuration_ = {});
|
PlannerConfiguration planner_configuration_ = {});
|
||||||
|
|
||||||
|
/// Initialize planner with query tree after query analysis phase and planner context
|
||||||
|
Planner(const QueryTreeNodePtr & query_tree_,
|
||||||
|
const SelectQueryOptions & select_query_options_,
|
||||||
|
PlannerContextPtr planner_context_,
|
||||||
|
PlannerConfiguration planner_configuration_ = {});
|
||||||
|
|
||||||
const QueryPlan & getQueryPlan() const
|
const QueryPlan & getQueryPlan() const
|
||||||
{
|
{
|
||||||
return query_plan;
|
return query_plan;
|
||||||
|
@ -663,8 +663,12 @@ void StorageDistributed::read(
|
|||||||
StorageID remote_storage_id{remote_database, remote_table};
|
StorageID remote_storage_id{remote_database, remote_table};
|
||||||
auto query_tree_with_replaced_distributed_table = buildQueryTreeDistributedTableReplacedWithLocalTable(query_info, remote_storage_id);
|
auto query_tree_with_replaced_distributed_table = buildQueryTreeDistributedTableReplacedWithLocalTable(query_info, remote_storage_id);
|
||||||
query_ast = queryNodeToSelectQuery(query_tree_with_replaced_distributed_table);
|
query_ast = queryNodeToSelectQuery(query_tree_with_replaced_distributed_table);
|
||||||
Planner planner(query_tree_with_replaced_distributed_table, SelectQueryOptions(processed_stage), PlannerConfiguration{.only_analyze = true});
|
|
||||||
|
Planner planner(query_tree_with_replaced_distributed_table,
|
||||||
|
SelectQueryOptions(processed_stage),
|
||||||
|
PlannerConfiguration{.only_analyze = true});
|
||||||
planner.buildQueryPlanIfNeeded();
|
planner.buildQueryPlanIfNeeded();
|
||||||
|
|
||||||
header = planner.getQueryPlan().getCurrentDataStream().header;
|
header = planner.getQueryPlan().getCurrentDataStream().header;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -716,8 +720,12 @@ void StorageDistributed::read(
|
|||||||
|
|
||||||
if (local_context->getSettingsRef().allow_experimental_analyzer)
|
if (local_context->getSettingsRef().allow_experimental_analyzer)
|
||||||
{
|
{
|
||||||
Planner planner(query_info.query_tree, SelectQueryOptions(processed_stage), PlannerConfiguration{.only_analyze = true});
|
Planner planner(query_info.query_tree,
|
||||||
|
SelectQueryOptions(processed_stage),
|
||||||
|
query_info.planner_context,
|
||||||
|
PlannerConfiguration{.only_analyze = true});
|
||||||
planner.buildQueryPlanIfNeeded();
|
planner.buildQueryPlanIfNeeded();
|
||||||
|
|
||||||
auto expected_header = planner.getQueryPlan().getCurrentDataStream().header;
|
auto expected_header = planner.getQueryPlan().getCurrentDataStream().header;
|
||||||
|
|
||||||
auto rename_actions_dag = ActionsDAG::makeConvertingActions(
|
auto rename_actions_dag = ActionsDAG::makeConvertingActions(
|
||||||
|
Loading…
Reference in New Issue
Block a user