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


##########
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:
   ```
   ❯  target/debug/datafusion-cli -q --maxwidth 20 \
        -c 'EXPLAIN SELECT 123'
   physical_plan
   ┌───────────────────────────┐
   │       ProjectionExec      │
   │    --------------------   │
   │      Int64(123): 123      │
   └─────────────┬─────────────┘
   ┌─────────────┴─────────────┐
   │     PlaceholderRowExec    │
   └───────────────────────────┘
   
   ```



-- 
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