alamb opened a new issue, #15020:
URL: https://github.com/apache/datafusion/issues/15020

   ### Is your feature request related to a problem or challenge?
   
   - part of https://github.com/apache/datafusion/issues/14914 
   
   We are working on a new user focused explain format
   
   The current explain format has a logical plan and a physical plan. This 
split is important for people developing DataFusion but not as much for users. 
   
   
   For example, the query like this
   ```sql
   set datafusion.explain.format = "tree";
   
    create table  table1 (
     int_col INT,
     string_col TEXT,
     bigint_col BIGINT,
     date_col DATE
   ) as VALUES (1, 'foo', 1, '2023-01-01'), (2, 'bar', 2, '2023-01-02'), (3, 
'baz', 3, '2023-01-03');
   0 row(s) fetched.
   
   explain SELECT int_col FROM table1
   WHERE string_col != 'foo' AND string_col != 'bar' AND string_col != 'a 
really long string constant'
   ```
   
   The output looks like this (note the `logical_plan` line that is very wide)
   
   ```sql
   
+---------------+------------------------------------------------------------------------------------------------------------------------------------------------+
   | plan_type     | plan                                                       
                                                                                
    |
   
+---------------+------------------------------------------------------------------------------------------------------------------------------------------------+
   | logical_plan  | Projection: table1.int_col                                 
                                                                                
    |
   |               |   Filter: table1.string_col != Utf8("foo") AND 
table1.string_col != Utf8("bar") AND table1.string_col != Utf8("a really long 
string constant") |
   |               |     TableScan: table1 projection=[int_col, string_col]     
                                                                                
    |
   | physical_plan | ┌───────────────────────────┐                              
                                                                                
    |
   |               | │    CoalesceBatchesExec    │                              
                                                                                
    |
   |               | └─────────────┬─────────────┘                              
                                                                                
    |
   |               | ┌─────────────┴─────────────┐                              
                                                                                
    |
   |               | │         FilterExec        │                              
                                                                                
    |
   |               | │    --------------------   │                              
                                                                                
    |
   |               | │         predicate:        │                              
                                                                                
    |
   |               | │string_col@1 != foo AND ...│                              
                                                                                
    |
   |               | └─────────────┬─────────────┘                              
                                                                                
    |
   |               | ┌─────────────┴─────────────┐                              
                                                                                
    |
   |               | │       DataSourceExec      │                              
                                                                                
    |
   |               | │    --------------------   │                              
                                                                                
    |
   |               | │    partition_sizes: [1]   │                              
                                                                                
    |
   |               | │       partitions: 1       │                              
                                                                                
    |
   |               | └───────────────────────────┘                              
                                                                                
    |
   |               |                                                            
                                                                                
    |
   
+---------------+------------------------------------------------------------------------------------------------------------------------------------------------+
   2 row(s) fetched.
   ```
   
   ### Describe the solution you'd like
   
   I would like to hide the logical plan in tree mode.
   
   So for the example above, that would look something like
   
   
   ```sql
   +---------------+---------------------------------------+
   | plan_type     | plan                                                       
                                                                                
    |
   +---------------+---------------------------------------+
   | physical_plan | ┌───────────────────────────┐                              
                                                                                
    |
   |               | │    CoalesceBatchesExec    │                              
                                                                                
    |
   |               | └─────────────┬─────────────┘                              
                                                                                
    |
   |               | ┌─────────────┴─────────────┐                              
                                                                                
    |
   |               | │         FilterExec        │                              
                                                                                
    |
   |               | │    --------------------   │                              
                                                                                
    |
   |               | │         predicate:        │                              
                                                                                
    |
   |               | │string_col@1 != foo AND ...│                              
                                                                                
    |
   |               | └─────────────┬─────────────┘                              
                                                                                
    |
   |               | ┌─────────────┴─────────────┐                              
                                                                                
    |
   |               | │       DataSourceExec      │                              
                                                                                
    |
   |               | │    --------------------   │                              
                                                                                
    |
   |               | │    partition_sizes: [1]   │                              
                                                                                
    |
   |               | │       partitions: 1       │                              
                                                                                
    |
   |               | └───────────────────────────┘                              
                                                                                
    |
   |               |                                                            
                                                                                
    |
   +---------------+--------------------------------------+
   ```
   
   ### Describe alternatives you've considered
   
   _No response_
   
   ### Additional context
   
   I think this is a fairly straightforward issue and there are existing tests 
so marking as a good first issue


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