irenjj commented on code in PR #15140: URL: https://github.com/apache/datafusion/pull/15140#discussion_r1989268937
########## datafusion/physical-plan/src/sorts/sort_preserving_merge.rs: ########## @@ -186,8 +186,15 @@ impl DisplayAs for SortPreservingMergeExec { Ok(()) } DisplayFormatType::TreeRender => { - // TODO: collect info - write!(f, "") + for (i, e) in self.expr().iter().enumerate() { + let e = e.to_string(); + writeln!(f, "expr{i}={e}")?; + } + if let Some(fetch) = self.fetch { + writeln!(f, "fetch={fetch}")?; Review Comment: Nitpick: To be compatible with other `Sort*` physical plan, we'd better use `limit` ########## datafusion/physical-plan/src/sorts/sort_preserving_merge.rs: ########## @@ -186,8 +186,15 @@ impl DisplayAs for SortPreservingMergeExec { Ok(()) } DisplayFormatType::TreeRender => { - // TODO: collect info - write!(f, "") + for (i, e) in self.expr().iter().enumerate() { + let e = e.to_string(); + writeln!(f, "expr{i}={e}")?; + } Review Comment: In the latest version(#15125), we are no longer limited to using KV to represent each line of output, so as @2010YOUY01 said, may be we can print sorted keys with out the prefix `expr:` like: ``` date@0 ASC NULLS LAST time@2 ASC NULLS LAST ... ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org