diff --git a/datafusion/physical-plan/src/projection.rs b/datafusion/physical-plan/src/projection.rs index cc2ab62049ed..3e185e4ff4b8 100644 --- a/datafusion/physical-plan/src/projection.rs +++ b/datafusion/physical-plan/src/projection.rs @@ -141,7 +141,17 @@ impl DisplayAs for ProjectionExec { }) .collect(); - write!(f, "ProjectionExec: expr=[{}]", expr.join(", ")) + match self.output_ordering() { + Some(exprs) => { + write!( + f, + "ProjectionExec: expr=[{}], sort_expr=[{}]", + expr.join(", "), + PhysicalSortExpr::format_list(exprs) + ) + } + _ => write!(f, "ProjectionExec: expr=[{}]", expr.join(", ")), + } } } }