blaginin commented on code in PR #27437:
URL: https://github.com/apache/datafusion/pull/27437#discussion_r4593185375


##########
datafusion-cli/src/exec.rs:
##########
@@ -250,10 +250,33 @@ impl StatementExecutor {
         let (df, adjusted) = self
             .create_and_execute_logical_plan(ctx, print_options)
             .await?;
+        let (print_options, table_options) = adjusted.into_options();
+        let df = if table_options.explain_format == Some(ExplainFormat::Tree)
+            && print_options.format == PrintFormat::Table
+        {
+            let (mut state, plan) = df.into_parts();
+            let render_width = match (table_options.width, 
print_options.maxwidth) {
+                (Some(width), _) => {
+                    // The renderer emits whole 29-column boxes, rounding its 
limit up.
+                    Some((usize::from(width) / 29 * 29).max(1))

Review Comment:
   i think sometimes it actually makes sense to go beyond? when the canvas is 
too small. removed maxwidth to make it more obvious



##########
datafusion-cli/src/command.rs:
##########
@@ -248,6 +252,15 @@ impl FromStr for OutputFormat {
 impl OutputFormat {
     pub fn execute(&self, print_options: &mut PrintOptions) -> Result<()> {
         match self {
+            Self::ChangeMaxWidth(width) => {

Review Comment:
   sure



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to