You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/04/29 08:55:54 UTC

[GitHub] [arrow-datafusion] tustvold opened a new issue #219: Graphviz PhysicalPlan

tustvold opened a new issue #219:
URL: https://github.com/apache/arrow-datafusion/issues/219


   The ability to get a graphviz render of the LogicalPlans is awesome, it would be even more awesome to have a similar facility for PhysicalPlans.
   
   The way I'd envisage this working is with a new method added to the ExecutionPlan trait
   
   ```
   fn fmt_for_explain(&self, f: &mut fmt::Formatter) -> fmt::Result;
   ```
   
   This is copied wholesale from UserDefinedLogicalNode and would function in much the same way.  This would have a default placeholder implementation to avoid this being a breaking change.
   
   A public free function would then be added to visit each node in a provided ExecutionPlan tree in turn and use this `fmt_for_explain` along with the existing schema function to produce a graphviz representation. (This could also be a trait function if preferred).
   
   FYI @alamb 


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] alamb commented on issue #219: Graphviz PhysicalPlan

Posted by GitBox <gi...@apache.org>.
alamb commented on issue #219:
URL: https://github.com/apache/arrow-datafusion/issues/219#issuecomment-829202935


   This also might relate to https://github.com/apache/arrow-datafusion/issues/96 (to add graphviz output somehow to explain plan)
   
   It would probably also be nice to improve the default physical plan explain plan so it didn't try and print out all low level details too.
   
   For example, an `explain verbose` today is both verbose and hard to read.
   
   ```
   Query execution complete in 700.985811ms
   844910ece80be8bc_apps> explain verbose select redis_version, used_memory_peak from redis limit 10;
   +-----------------------------------------+----------------------------------------------------------------------------------------------------------------------------+
   | plan_type                               | plan                                                                                                                       |
   +-----------------------------------------+----------------------------------------------------------------------------------------------------------------------------+
   | logical_plan                            | Limit: 10                                                                                                                  |
   |                                         |   Projection: #redis_version, #used_memory_peak                                                                            |
   |                                         |     TableScan: redis projection=None                                                                                       |
   | logical_plan after projection_push_down | Limit: 10                                                                                                                  |
   |                                         |   Projection: #redis_version, #used_memory_peak                                                                            |
   |                                         |     TableScan: redis projection=Some([67, 99])                                                                             |
   | logical_plan after projection_push_down | Limit: 10                                                                                                                  |
   |                                         |   Projection: #redis_version, #used_memory_peak                                                                            |
   |                                         |     TableScan: redis projection=Some([67, 99])                                                                             |
   | physical_plan                           | GlobalLimitExec {                                                                                                          |
   |                                         |     input: LocalLimitExec {                                                                                                |
   |                                         |         input: ProjectionExec {                                                                                            |
   |                                         |             expr: [                                                                                                        |
   |                                         |                 (                                                                                                          |
   |                                         |                     Column {                                                                                               |
   
   ```


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org