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


   **Describe the bug**
   The output of EXPLAIN when the query has a `UNION ALL` contains placeholder 
text rather than the operator name
   
   **To Reproduce**
   Reproducer:
   ```shell
   echo "1,A" > /tmp/foo.csv
   echo "1,B" >> /tmp/foo.csv
   echo "2,A" >> /tmp/foo.csv
   ```
   
   Run CLI
   ```shell
   cargo run --bin datafusion-cli
   ```
   
   
   ```sql
   CREATE EXTERNAL TABLE foo(x INT, b VARCHAR) STORED AS CSV LOCATION 
'/tmp/foo.csv';
   
   EXPLAIN SELECT x FROM foo UNION ALL SELECT x FROM foo;
   ```
   
   Actual output:
   ```sql
   > EXPLAIN SELECT x FROM foo UNION ALL SELECT x FROM foo;
   
+---------------+----------------------------------------------------------------------------+
   | plan_type     | plan                                                       
                |
   
+---------------+----------------------------------------------------------------------------+
   | logical_plan  | Union                                                      
                |
   |               |   Projection: #foo.x                                       
                |
   |               |     TableScan: foo projection=Some([0])                    
                |
   |               |   Projection: #foo.x                                       
                |
   |               |     TableScan: foo projection=Some([0])                    
                |
   | physical_plan | ExecutionPlan(PlaceHolder)                                 
                |
   |               |   ProjectionExec: expr=[x@0 as x]                          
                |
   |               |     RepartitionExec: partitioning=RoundRobinBatch(16)      
                |
   |               |       CsvExec: source=Path(/tmp/foo.csv: [/tmp/foo.csv]), 
has_header=false |
   |               |   ProjectionExec: expr=[x@0 as x]                          
                |
   |               |     RepartitionExec: partitioning=RoundRobinBatch(16)      
                |
   |               |       CsvExec: source=Path(/tmp/foo.csv: [/tmp/foo.csv]), 
has_header=false |
   
+---------------+----------------------------------------------------------------------------+
   ```
   
   Note the `ExecutionPlan(PlaceHolder)` which is the placeholder txt.
   
   
   **Expected behavior**
   I expect `ExecutionPlan(PlaceHolder)` to say `UnionExec` or something similar
   
   **Additional context**
   I think the `fmt_as` needs to be implemented for the `UnionExec` operator
   
   It would also be cool to review all `impl ExecutionPlan` in DataFusion to 
make sure `fmt_as` has been provded


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


Reply via email to