-
Notifications
You must be signed in to change notification settings - Fork 150
Unable to print EXPLAIN #1014
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
EXPLAIN statement could not be printed with the following error.
Exception: Internal error: Unsupported logical plan: Explain must be root of the plan.
This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker
To Reproduce
Steps to reproduce the behavior:
>>> from datafusion import SessionContext
>>> ctx = SessionContext()
>>> ctx.sql("explain select 1")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/kuhuan/.local/lib/python3.10/site-packages/datafusion/dataframe.py", line 71, in __repr__
return self.df.__repr__()
Exception: Internal error: Unsupported logical plan: Explain must be root of the plan.
This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker
Expected behavior
The output should just be like using explain function
>>> ctx.sql("select 1").explain()
DataFrame()
+---------------+--------------------------------------+
| plan_type | plan |
+---------------+--------------------------------------+
| logical_plan | Projection: Int64(1) |
| | EmptyRelation |
| physical_plan | ProjectionExec: expr=[1 as Int64(1)] |
| | PlaceholderRowExec |
| | |
+---------------+--------------------------------------+
Additional context
Add any other context about the problem here.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Fields
Give feedbackNo fields configured for issues without a type.