Skip to content

Commit ed2c1ca

Browse files
authored
Do not display logical_plan win explain tree mode (#15132)
1 parent 6e422e0 commit ed2c1ca

File tree

3 files changed

+5
-156
lines changed

3 files changed

+5
-156
lines changed

datafusion/core/src/physical_planner.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1727,7 +1727,10 @@ impl DefaultPhysicalPlanner {
17271727
let config = &session_state.config_options().explain;
17281728
let explain_format = DisplayFormatType::from_str(&config.format)?;
17291729

1730-
if !config.physical_plan_only {
1730+
let skip_logical_plan = config.physical_plan_only
1731+
|| explain_format == DisplayFormatType::TreeRender;
1732+
1733+
if !skip_logical_plan {
17311734
stringified_plans.clone_from(&e.stringified_plans);
17321735
if e.logical_optimization_succeeded {
17331736
stringified_plans.push(e.plan.to_stringified(FinalLogicalPlan));

datafusion/physical-plan/src/display.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ use crate::render_tree::RenderTree;
3434
use super::{accept, ExecutionPlan, ExecutionPlanVisitor};
3535

3636
/// Options for controlling how each [`ExecutionPlan`] should format itself
37-
#[derive(Debug, Clone, Copy)]
37+
#[derive(Debug, Clone, Copy, PartialEq)]
3838
pub enum DisplayFormatType {
3939
/// Default, compact format. Example: `FilterExec: c12 < 10.0`
4040
///

0 commit comments

Comments
 (0)