Kontinuation opened a new pull request, #92:
URL: https://github.com/apache/sedona-db/pull/92
This patch fixes the following error when `show`ing a DataFrame backed by an
`EXPLAIN ...` query:
```python
>>> import sedonadb
>>> con = sedonadb.connect()
>>> con.sql("EXPLAIN SELECT 1 as one").show()
Traceback (most recent call last):
File "<python-input-4>", line 1, in <module>
con.sql("EXPLAIN SELECT 1 as one").show()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File
"/Users/bopeng/workspace/wherobots/sedona-db/python/sedonadb/python/sedonadb/dataframe.py",
line 362, in show
print(self._impl.show(self._ctx, limit, width, ascii), end="")
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sedonadb._lib.SedonaError: Unsupported logical plan: Explain must be root of
the plan.
This issue was likely caused by a bug in DataFusion's code. Please help us
to resolve this by filing a bug report in our issue tracker:
https://github.com/apache/datafusion/issues
```
The above code will run successfully after applying this patch:
```
>>> import sedonadb
>>> con = sedonadb.connect()
>>> con.sql("EXPLAIN SELECT 1 as one").show()
┌───────────────┬─────────────────────────────────┐
│ plan_type ┆ plan │
│ utf8 ┆ utf8 │
╞═══════════════╪═════════════════════════════════╡
│ logical_plan ┆ Projection: Int64(1) AS one │
│ ┆ EmptyRelation │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ physical_plan ┆ ProjectionExec: expr=[1 as one] │
│ ┆ PlaceholderRowExec │
│ ┆ │
└───────────────┴─────────────────────────────────┘
```
This patch also added an `explain` method to `DataFrame`.
--
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]