vtlim commented on code in PR #13033:
URL: https://github.com/apache/druid/pull/13033#discussion_r963970313
##########
docs/querying/sql-translation.md:
##########
@@ -63,37 +63,137 @@ appreciated.
## Interpreting EXPLAIN PLAN output
The [EXPLAIN PLAN](sql.md#explain-plan) functionality can help you understand
how a given SQL query will
-be translated to native. For simple queries that do not involve subqueries or
joins, the output of EXPLAIN PLAN
-is easy to interpret. The native query that will run is embedded as JSON
inside a "DruidQueryRel" line:
-
-```
-> EXPLAIN PLAN FOR SELECT COUNT(*) FROM wikipedia
-
-DruidQueryRel(query=[{"queryType":"timeseries","dataSource":"wikipedia","intervals":"-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z","granularity":"all","aggregations":[{"type":"count","name":"a0"}]}],
signature=[{a0:LONG}])
+be translated to native. The native queries that will run are returned as a
JSON array in the PLAN column:
+
+```sql
+EXPLAIN PLAN FOR
+SELECT
+ channel,
+ COUNT(*)
+FROM wikipedia
+WHERE channel IN (SELECT page FROM wikipedia GROUP BY page ORDER BY COUNT(*)
DESC LIMIT 10)
+GROUP BY channel
```
-For more complex queries that do involve subqueries or joins, EXPLAIN PLAN is
somewhat more difficult to interpret.
-For example, consider this query:
+Returns the following plan:
Review Comment:
```suggestion
The EXPLAIN PLAN statement returns the following plan:
```
##########
docs/querying/sql-translation.md:
##########
@@ -63,37 +63,137 @@ appreciated.
## Interpreting EXPLAIN PLAN output
The [EXPLAIN PLAN](sql.md#explain-plan) functionality can help you understand
how a given SQL query will
-be translated to native. For simple queries that do not involve subqueries or
joins, the output of EXPLAIN PLAN
-is easy to interpret. The native query that will run is embedded as JSON
inside a "DruidQueryRel" line:
-
-```
-> EXPLAIN PLAN FOR SELECT COUNT(*) FROM wikipedia
-
-DruidQueryRel(query=[{"queryType":"timeseries","dataSource":"wikipedia","intervals":"-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z","granularity":"all","aggregations":[{"type":"count","name":"a0"}]}],
signature=[{a0:LONG}])
+be translated to native. The native queries that will run are returned as a
JSON array in the PLAN column:
Review Comment:
```suggestion
be translated to native. The native queries that will run are returned as a
JSON array in the PLAN column. For example, consider the following query:
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]