Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(executor): fix broken query profiling graph #14183

Merged
merged 3 commits into from
Dec 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/query/service/src/pipelines/pipeline_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ use databend_common_expression::DataField;
use databend_common_expression::FunctionContext;
use databend_common_pipeline_core::Pipeline;
use databend_common_pipeline_core::PlanScope;
use databend_common_pipeline_core::PlanScopeGuard;
use databend_common_profile::SharedProcessorProfiles;
use databend_common_settings::Settings;
use databend_common_sql::executor::PhysicalPlan;
Expand Down Expand Up @@ -101,9 +102,18 @@ impl PipelineBuilder {
})
}

pub(crate) fn add_plan_scope(&mut self, plan: &PhysicalPlan) -> Option<PlanScopeGuard> {
match plan {
PhysicalPlan::EvalScalar(v) if v.exprs.is_empty() => None,
_ => {
let scope = PlanScope::create(plan.get_id(), plan.name());
Some(self.main_pipeline.add_plan_scope(scope))
}
}
}

pub(crate) fn build_pipeline(&mut self, plan: &PhysicalPlan) -> Result<()> {
let scope = PlanScope::create(plan.get_id(), plan.name());
let _guard = self.main_pipeline.add_plan_scope(scope);
let _guard = self.add_plan_scope(plan);
match plan {
PhysicalPlan::TableScan(scan) => self.build_table_scan(scan),
PhysicalPlan::CteScan(scan) => self.build_cte_scan(scan),
Expand Down
Loading