GitHub user HeartSaVioR opened a pull request:
https://github.com/apache/storm/pull/1681
STORM-1444 Support EXPLAIN statement in StormSQL
* when '--explain' is specified to topology name, activate explain mode
* when explain mode is activated, it analyzes each query statement, and
shows query plan
* it doesn't submit topologies
* Showing plan is provided by Calcite: it just uses that feature
As I also described to the doc, query plan for below query
```
INSERT INTO LARGE_ORDERS SELECT ID, UNIT_PRICE * QUANTITY AS TOTAL FROM
ORDERS
WHERE UNIT_PRICE * QUANTITY > 50
```
is shown as:
```
LogicalTableModify(table=[[LARGE_ORDERS]], operation=[INSERT],
updateColumnList=[[]], flattened=[true]), id = 8
LogicalProject(ID=[$0], TOTAL=[*($1, $2)]), id = 7
LogicalFilter(condition=[>(*($1, $2), 50)]), id = 6
EnumerableTableScan(table=[[ORDERS]]), id = 5
```
FYI, $0 is column index 0 (starting from 0), and so on. Expression is
printed as prefix notation.
Calcite just provides this functionality, though I'm not clear whether this
is friendly (acceptable by end-user) or not.
There's staled issue from Calcite
([CALCITE-155](https://issues.apache.org/jira/browse/CALCITE-155)) for
displaying actual column names/aliases in explain plan.
Please have a look and share your opinion about this.
Thanks in advance!
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/HeartSaVioR/storm STORM-1444
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/storm/pull/1681.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1681
----
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---