[GitHub] [spark] maropu commented on a change in pull request #26970: [SPARK-28825][SQL][DOC] Documentation for Explain Command

2020-01-02 Thread GitBox
maropu commented on a change in pull request #26970: [SPARK-28825][SQL][DOC] 
Documentation for Explain Command
URL: https://github.com/apache/spark/pull/26970#discussion_r362446099
 
 

 ##
 File path: docs/sql-ref-syntax-qry-explain.md
 ##
 @@ -19,4 +19,112 @@ license: |
   limitations under the License.
 ---
 
-**This page is under construction**
+### Description
+
+The `EXPLAIN` statement is used to provide logical/physical plans for an input 
statement. 
+By default, this clause provides information about a physical plan only.
+
+
+### Syntax
+{% highlight sql %}
+EXPLAIN [EXTENDED | CODEGEN | COST | FORMATTED] statement
+{% endhighlight %}
+
+### Parameters
+
+
+  EXTENDED
+  Generates Parsed Logical Plan, Analyzed Logical Plan, Optimized Logical 
Plan and Physical Plan.
+   Parsed Logical plan is a unresolved plan that extracted from the query.
+   Analyzed logical plans transforms which translates UnresolvedAttribute and 
UnresolvedRelation into fully typed objects.
+   The optimized logical plan transforms through a set of optimization rules, 
resulting in the Physical plan.
+  
+ 
+
+
+  CODEGEN
+  Generates code for the statement, if any and a Physical Plan.
+
+
+
+  COST
+  If plan node statistics are available, generates a logical plan and the 
statistics.
+
+
+
+  FORMATTED
+  Generates two sections: a physical plan outline and node details.
+
+
+
+  statement
+  
+Specifies a SQL statement to be explained.
+  
+ 
+
+### Examples
+{% highlight sql %}
+
+--Default Output
+
+EXPLAIN select * from emp;
+++
+|plan|
+++
+| == Physical Plan ==
+*(1) ColumnarToRow
++- FileScan parquet default.emp[id#0] Batched: true, DataFilters: [], Format: 
Parquet, Location: 
InMemoryFileIndex[file:/home/root1/Spark/spark/spark-warehouse/emp], 
PartitionFilters: [], PushedFilters: [], ReadSchema: struct
 
 Review comment:
   How about just using a simpler query? e.g.,
   ```
   scala> sql("explain select k, sum(v) from values (1, 2), (1, 3) t(k, v) 
group by k").show(1, false)
   
++
   |plan


|
   
++
   |== Physical Plan ==
   *(2) HashAggregate(keys=[k#5], functions=[sum(cast(v#6 as bigint))])
   +- Exchange hashpartitioning(k#5, 200), true, [id=#16]
  +- *(1) HashAggregate(keys=[k#5], functions=[partial_sum(cast(v#6 as 
bigint))])
 +- *(1) LocalTableScan [k#5, v#6]
   
   |
   
++
   ```


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] [spark] maropu commented on a change in pull request #26970: [SPARK-28825][SQL][DOC] Documentation for Explain Command

2020-01-02 Thread GitBox
maropu commented on a change in pull request #26970: [SPARK-28825][SQL][DOC] 
Documentation for Explain Command
URL: https://github.com/apache/spark/pull/26970#discussion_r362435876
 
 

 ##
 File path: docs/sql-ref-syntax-qry-explain.md
 ##
 @@ -19,4 +19,112 @@ license: |
   limitations under the License.
 ---
 
-**This page is under construction**
+### Description
+
+The `EXPLAIN` statement is used to provide logical/physical plans for an input 
statement. 
+By default, this clause provides information about a physical plan only.
+
+
+### Syntax
+{% highlight sql %}
+EXPLAIN [EXTENDED | CODEGEN | COST | FORMATTED] statement
+{% endhighlight %}
+
+### Parameters
+
+
+  EXTENDED
+  Generates Parsed Logical Plan, Analyzed Logical Plan, Optimized Logical 
Plan and Physical Plan.
+   Parsed Logical plan is a unresolved plan that extracted from the query.
+   Analyzed logical plans transforms which translates UnresolvedAttribute and 
UnresolvedRelation into fully typed objects.
+   The optimized logical plan transforms through a set of optimization rules, 
resulting in the Physical plan.
+  
+ 
+
+
+  CODEGEN
+  Generates code for the statement, if any and a Physical Plan.
+
+
+
+  COST
+  If plan node statistics are available, generates a logical plan and the 
statistics.
+
+
+
+  FORMATTED
+  Generates two sections: a physical plan outline and node details.
+
+
+
+  statement
+  
+Specifies a SQL statement to be explained.
+  
+ 
+
+### Examples
+{% highlight sql %}
+
+--Default Output
+
+EXPLAIN select * from emp;
+++
+|plan|
+++
+| == Physical Plan ==
+*(1) ColumnarToRow
++- FileScan parquet default.emp[id#0] Batched: true, DataFilters: [], Format: 
Parquet, Location: 
InMemoryFileIndex[file:/home/root1/Spark/spark/spark-warehouse/emp], 
PartitionFilters: [], PushedFilters: [], ReadSchema: struct
 
 Review comment:
   nit: can we avoid the environment-dependent info 
(`file:/home/root1/Spark/spark/...`) in this doc?


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] [spark] maropu commented on a change in pull request #26970: [SPARK-28825][SQL][DOC] Documentation for Explain Command

2020-01-02 Thread GitBox
maropu commented on a change in pull request #26970: [SPARK-28825][SQL][DOC] 
Documentation for Explain Command
URL: https://github.com/apache/spark/pull/26970#discussion_r362435598
 
 

 ##
 File path: docs/sql-ref-syntax-qry-explain.md
 ##
 @@ -19,4 +19,112 @@ license: |
   limitations under the License.
 ---
 
-**This page is under construction**
+### Description
+
+The `EXPLAIN` statement is used to provide logical/physical plans for an input 
statement. 
+By default, this clause provides information about a physical plan only.
+
+
+### Syntax
+{% highlight sql %}
+EXPLAIN [EXTENDED | CODEGEN | COST | FORMATTED] statement
+{% endhighlight %}
+
+### Parameters
+
+
+  EXTENDED
+  Generates Parsed Logical Plan, Analyzed Logical Plan, Optimized Logical 
Plan and Physical Plan.
+   Parsed Logical plan is a unresolved plan that extracted from the query.
+   Analyzed logical plans transforms which translates UnresolvedAttribute and 
UnresolvedRelation into fully typed objects.
+   The optimized logical plan transforms through a set of optimization rules, 
resulting in the Physical plan.
+  
+ 
+
+
+  CODEGEN
+  Generates code for the statement, if any and a Physical Plan.
 
 Review comment:
   ditto


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] [spark] maropu commented on a change in pull request #26970: [SPARK-28825][SQL][DOC] Documentation for Explain Command

2020-01-02 Thread GitBox
maropu commented on a change in pull request #26970: [SPARK-28825][SQL][DOC] 
Documentation for Explain Command
URL: https://github.com/apache/spark/pull/26970#discussion_r362435000
 
 

 ##
 File path: docs/sql-ref-syntax-qry-explain.md
 ##
 @@ -19,4 +19,112 @@ license: |
   limitations under the License.
 ---
 
-**This page is under construction**
+### Description
+
+The `EXPLAIN` statement is used to provide logical/physical plans for an input 
statement. 
+By default, this clause provides information about a physical plan only.
+
+
+### Syntax
+{% highlight sql %}
+EXPLAIN [EXTENDED | CODEGEN | COST | FORMATTED] statement
+{% endhighlight %}
+
+### Parameters
+
+
+  EXTENDED
+  Generates Parsed Logical Plan, Analyzed Logical Plan, Optimized Logical 
Plan and Physical Plan.
 
 Review comment:
   nit: please do not capitalize words in the middle of statements.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] [spark] maropu commented on a change in pull request #26970: [SPARK-28825][SQL][DOC] Documentation for Explain Command

2019-12-26 Thread GitBox
maropu commented on a change in pull request #26970: [SPARK-28825][SQL][DOC] 
Documentation for Explain Command
URL: https://github.com/apache/spark/pull/26970#discussion_r361433239
 
 

 ##
 File path: docs/sql-ref-syntax-qry-explain.md
 ##
 @@ -19,4 +19,126 @@ license: |
   limitations under the License.
 ---
 
-**This page is under construction**
+### Description
+
+The `EXPLAIN` statement provides the execution plan for the statement. 
+By default, `EXPLAIN` provides information about the physical plan.
+`EXPLAIN` does not support `DESCRIBE TABLE` statement.
+
+
+### Syntax
+{% highlight sql %}
+EXPLAIN [EXTENDED | CODEGEN | COST | FORMATTED] statement
+{% endhighlight %}
+
+### Parameters
+
+
+  EXTENDED
+  Generates Parsed Logical Plan, Analyzed Logical Plan, Optimized Logical 
Plan and Physical Plan.
+   Parsed Logical plan is a unresolved plan that extracted from the query.
+   Analyzed logical plans transforms which translates UnresolvedAttribute and 
UnresolvedRelation into fully typed objects.
+   The optimized logical plan transforms through a set of optimization rules, 
resulting in the Physical plan.
+  
+ 
+
+
+  CODEGEN
+  Generates code for the statement, if any and a Physical Plan.
+
+
+
+  COST
+  If plan node statistics are available, generates a logical plan and the 
statistics.
+
+
+
+  FORMATTED
+  Generates two sections: a physical plan outline and node details.
+
 
 Review comment:
   How about just `Specifies a SQL statement to be explained.`


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] [spark] maropu commented on a change in pull request #26970: [SPARK-28825][SQL][DOC] Documentation for Explain Command

2019-12-23 Thread GitBox
maropu commented on a change in pull request #26970: [SPARK-28825][SQL][DOC] 
Documentation for Explain Command
URL: https://github.com/apache/spark/pull/26970#discussion_r361028946
 
 

 ##
 File path: docs/sql-ref-syntax-qry-explain.md
 ##
 @@ -19,4 +19,126 @@ license: |
   limitations under the License.
 ---
 
-**This page is under construction**
+### Description
+
+The `EXPLAIN` statement provides the execution plan for the statement. 
+By default, `EXPLAIN` provides information about the physical plan.
+`EXPLAIN` does not support `DESCRIBE TABLE` statement.
+
+
+### Syntax
+{% highlight sql %}
+EXPLAIN [EXTENDED | CODEGEN | COST | FORMATTED] statement
+{% endhighlight %}
+
+### Parameters
+
+
+  EXTENDED
+  Generates Parsed Logical Plan, Analyzed Logical Plan, Optimized Logical 
Plan and Physical Plan.
+   Parsed Logical plan is a unresolved plan that extracted from the query.
+   Analyzed logical plans transforms which translates UnresolvedAttribute and 
UnresolvedRelation into fully typed objects.
+   The optimized logical plan transforms through a set of optimization rules, 
resulting in the Physical plan.
+  
+ 
+
+
+  CODEGEN
+  Generates code for the statement, if any and a Physical Plan.
+
+
+
+  COST
+  If plan node statistics are available, generates a logical plan and the 
statistics.
+
+
+
+  FORMATTED
+  Generates two sections: a physical plan outline and node details.
+
 
 Review comment:
   Where's a description about `input_statement`? See: 
https://github.com/apache/spark/blob/master/docs/sql-ref-syntax-aux-describe-query.md#parameters


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] [spark] maropu commented on a change in pull request #26970: [SPARK-28825][SQL][DOC] Documentation for Explain Command

2019-12-23 Thread GitBox
maropu commented on a change in pull request #26970: [SPARK-28825][SQL][DOC] 
Documentation for Explain Command
URL: https://github.com/apache/spark/pull/26970#discussion_r361028828
 
 

 ##
 File path: docs/sql-ref-syntax-qry-explain.md
 ##
 @@ -19,4 +19,126 @@ license: |
   limitations under the License.
 ---
 
-**This page is under construction**
+### Description
+
+The `EXPLAIN` statement provides the execution plan for the statement. 
+By default, `EXPLAIN` provides information about the physical plan.
+`EXPLAIN` does not support `DESCRIBE TABLE` statement.
+
+
+### Syntax
+{% highlight sql %}
+EXPLAIN [EXTENDED | CODEGEN | COST | FORMATTED] statement
+{% endhighlight %}
+
+### Parameters
+
+
+  EXTENDED
+  Generates Parsed Logical Plan, Analyzed Logical Plan, Optimized Logical 
Plan and Physical Plan.
+   Parsed Logical plan is a unresolved plan that extracted from the query.
+   Analyzed logical plans transforms which translates UnresolvedAttribute and 
UnresolvedRelation into fully typed objects.
+   The optimized logical plan transforms through a set of optimization rules, 
resulting in the Physical plan.
+  
+ 
+
+
+  CODEGEN
+  Generates code for the statement, if any and a Physical Plan.
+
+
+
+  COST
+  If plan node statistics are available, generates a logical plan and the 
statistics.
+
+
+
+  FORMATTED
+  Generates two sections: a physical plan outline and node details.
+
+
+### Examples
+{% highlight sql %}
+
+-- Using Extended
 
 Review comment:
   Let's put the three examples here: the default case, the extended case, and 
the formatted case.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] [spark] maropu commented on a change in pull request #26970: [SPARK-28825][SQL][DOC] Documentation for Explain Command

2019-12-23 Thread GitBox
maropu commented on a change in pull request #26970: [SPARK-28825][SQL][DOC] 
Documentation for Explain Command
URL: https://github.com/apache/spark/pull/26970#discussion_r361028626
 
 

 ##
 File path: docs/sql-ref-syntax-qry-explain.md
 ##
 @@ -19,4 +19,126 @@ license: |
   limitations under the License.
 ---
 
-**This page is under construction**
+### Description
+
+The `EXPLAIN` statement provides the execution plan for the statement. 
+By default, `EXPLAIN` provides information about the physical plan.
+`EXPLAIN` does not support `DESCRIBE TABLE` statement.
+
+
+### Syntax
+{% highlight sql %}
+EXPLAIN [EXTENDED | CODEGEN | COST | FORMATTED] statement
+{% endhighlight %}
+
+### Parameters
+
+
+  EXTENDED
+  Generates Parsed Logical Plan, Analyzed Logical Plan, Optimized Logical 
Plan and Physical Plan.
+   Parsed Logical plan is a unresolved plan that extracted from the query.
+   Analyzed logical plans transforms which translates UnresolvedAttribute and 
UnresolvedRelation into fully typed objects.
+   The optimized logical plan transforms through a set of optimization rules, 
resulting in the Physical plan.
+  
+ 
+
+
+  CODEGEN
+  Generates code for the statement, if any and a Physical Plan.
+
+
+
+  COST
+  If plan node statistics are available, generates a logical plan and the 
statistics.
+
+
+
+  FORMATTED
+  Generates two sections: a physical plan outline and node details.
+
+
+### Examples
+{% highlight sql %}
+
+-- Using Extended
+
+EXPLAIN EXTENDED select * from emp;
+++
+|plan|
+++
+| == Parsed Logical Plan ==
+'Project [*]
++- 'UnresolvedRelation [emp]
+
+== Analyzed Logical Plan ==
+id: int
+Project [id#0]
++- SubqueryAlias `default`.`emp`
+   +- Relation[id#0] parquet
+
+== Optimized Logical Plan ==
+Relation[id#0] parquet
+
+== Physical Plan ==
+*(1) ColumnarToRow
++- FileScan parquet default.emp[id#0] Batched: true, DataFilters: [], Format: 
Parquet, Location: 
InMemoryFileIndex[file:/home/root1/Spark/spark/spark-warehouse/emp], 
PartitionFilters: [], PushedFilters: [], ReadSchema: struct
+ |
+++
+
+--Default Output
+
+EXPLAIN select * from emp;
+++
+|plan|
+++
+| == Physical Plan ==
+*(1) ColumnarToRow
++- FileScan parquet default.emp[id#0] Batched: true, DataFilters: [], Format: 
Parquet, Location: 
InMemoryFileIndex[file:/home/root1/Spark/spark/spark-warehouse/emp], 
PartitionFilters: [], PushedFilters: [], ReadSchema: struct
+
+ |
+++
+
+-- Using Cost 
+EXPLAIN COST select * from emp;
+++
+|plan|
+++
+| == Optimized Logical Plan ==
+Relation[id#5] parquet, Statistics(sizeInBytes=421.0 B)
+
+== Physical Plan ==
+*(1) ColumnarToRow
++- FileScan parquet default.emp[id#5] Batched: true, DataFilters: [], Format: 
Parquet, Location: 
InMemoryFileIndex[file:/home/root1/Spark/spark/spark-warehouse/emp], 
PartitionFilters: [], PushedFilters: [], ReadSchema: struct
+
+ |
+++
+
+--Using Formatted
+
+EXPLAIN FORMATTED select * from emp;
+++
+|plan|
+++
+| == Physical Plan ==
+* ColumnarToRow (2)
++- Scan parquet default.emp (1)
+
+
+(1) Scan parquet default.emp 
+Output: [id#5]
+Batched: true
+Location: InMemoryFileIndex [file:/home/root1/Spark/spark/spark-warehouse/emp]
+ReadSchema: structid:int
+ 
+(2) ColumnarToRow [codegen id : 1]
+Input: [id#5]
+ 
+ |
+++
+
+
+-- Using CODEGEN
+
+EXPLAIN CODEGEN select * from emp;
 
 Review comment:
   I think we don't need this CODEGEN example.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] [spark] maropu commented on a change in pull request #26970: [SPARK-28825][SQL][DOC] Documentation for Explain Command

2019-12-23 Thread GitBox
maropu commented on a change in pull request #26970: [SPARK-28825][SQL][DOC] 
Documentation for Explain Command
URL: https://github.com/apache/spark/pull/26970#discussion_r361028462
 
 

 ##
 File path: docs/sql-ref-syntax-qry-explain.md
 ##
 @@ -19,4 +19,126 @@ license: |
   limitations under the License.
 ---
 
-**This page is under construction**
+### Description
+
+The `EXPLAIN` statement provides the execution plan for the statement. 
+By default, `EXPLAIN` provides information about the physical plan.
 
 Review comment:
   nit: By default, this clause provides information about a physical plan only.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] [spark] maropu commented on a change in pull request #26970: [SPARK-28825][SQL][DOC] Documentation for Explain Command

2019-12-23 Thread GitBox
maropu commented on a change in pull request #26970: [SPARK-28825][SQL][DOC] 
Documentation for Explain Command
URL: https://github.com/apache/spark/pull/26970#discussion_r361028289
 
 

 ##
 File path: docs/sql-ref-syntax-qry-explain.md
 ##
 @@ -19,4 +19,126 @@ license: |
   limitations under the License.
 ---
 
-**This page is under construction**
+### Description
+
+The `EXPLAIN` statement provides the execution plan for the statement. 
 
 Review comment:
   How about `The EXPLAIN statement is used to provide logical/physical plans 
for an input statement. `?


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] [spark] maropu commented on a change in pull request #26970: [SPARK-28825][SQL][DOC] Documentation for Explain Command

2019-12-23 Thread GitBox
maropu commented on a change in pull request #26970: [SPARK-28825][SQL][DOC] 
Documentation for Explain Command
URL: https://github.com/apache/spark/pull/26970#discussion_r361027978
 
 

 ##
 File path: docs/sql-ref-syntax-qry-explain.md
 ##
 @@ -19,4 +19,126 @@ license: |
   limitations under the License.
 ---
 
-**This page is under construction**
+### Description
+
+The `EXPLAIN` statement provides the execution plan for the statement. 
+By default, `EXPLAIN` provides information about the physical plan.
+`EXPLAIN` does not support `DESCRIBE TABLE` statement.
 
 Review comment:
   What does this statement mean? We can accept `EXPLAIN DESCRIBE TABLE`;
   ```
   scala> sql("explain describe table gstest_empty").show(1, false)
   
+---+
   |plan
   |
   
+---+
   |== Physical Plan ==
   Execute DescribeTableCommand
  +- DescribeTableCommand `gstest_empty`, false
   
   |
   
+---+
   ```


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] [spark] maropu commented on a change in pull request #26970: [SPARK-28825][SQL][DOC] Documentation for Explain Command

2019-12-23 Thread GitBox
maropu commented on a change in pull request #26970: [SPARK-28825][SQL][DOC] 
Documentation for Explain Command
URL: https://github.com/apache/spark/pull/26970#discussion_r361027802
 
 

 ##
 File path: docs/sql-ref-syntax-qry-explain.md
 ##
 @@ -19,4 +19,126 @@ license: |
   limitations under the License.
 ---
 
-**This page is under construction**
+### Description
+
+The `EXPLAIN` statement provides the execution plan for the statement. 
+By default, `EXPLAIN` provides information about the physical plan.
+`EXPLAIN` does not support `DESCRIBE TABLE` statement.
+
+
+### Syntax
+{% highlight sql %}
+EXPLAIN [EXTENDED | CODEGEN | COST | FORMATTED] statement
 
 Review comment:
   Since its better to follow the other docs, `statement` -> `input_statement`? 
https://github.com/apache/spark/blob/master/docs/sql-ref-syntax-aux-describe-query.md#syntax
   Can you check again that kind of consistency for the other statements, too?


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] [spark] maropu commented on a change in pull request #26970: [SPARK-28825][SQL][DOC] Documentation for Explain Command

2019-12-22 Thread GitBox
maropu commented on a change in pull request #26970: [SPARK-28825][SQL][DOC] 
Documentation for Explain Command
URL: https://github.com/apache/spark/pull/26970#discussion_r360735963
 
 

 ##
 File path: docs/sql-ref-syntax-qry-explain.md
 ##
 @@ -19,4 +19,157 @@ license: |
   limitations under the License.
 ---
 
-**This page is under construction**
+### Description
+
+The `EXPLAIN` statement provides the execution plan for the statement. 
+By default, `EXPLAIN` provides information about the physical plan.
+`EXPLAIN` does not support 'DESCRIBE TABLE' statement.
+
+
+### Syntax
+{% highlight sql %}
+EXPLAIN [EXTENDED | CODEGEN] statement
+{% endhighlight %}
+
+### Parameters
+
+
+  EXTENDED
+  Generates Parsed Logical Plan, Analyzed Logical Plan, Optimized Logical 
Plan and Physical Plan.
+ 
+
+
+  CODEGEN
+  Generates code for the statement, if any.
+
+
+### Examples
+{% highlight sql %}
+
+--Using Extended
+
+EXPLAIN EXTENDED select * from emp;
+++
+|plan|
+++
+| == Parsed Logical Plan ==
+'Project [*]
++- 'UnresolvedRelation [emp]
+
+== Analyzed Logical Plan ==
+id: int
+Project [id#0]
++- SubqueryAlias `default`.`emp`
+   +- Relation[id#0] parquet
+
+== Optimized Logical Plan ==
+Relation[id#0] parquet
+
+== Physical Plan ==
+*(1) ColumnarToRow
++- FileScan parquet default.emp[id#0] Batched: true, DataFilters: [], Format: 
Parquet, Location: 
InMemoryFileIndex[file:/home/root1/Spark/spark/spark-warehouse/emp], 
PartitionFilters: [], PushedFilters: [], ReadSchema: struct
+ |
+++
+
+--Default Output
+
+EXPLAIN select * from emp;
+++
+|plan|
+++
+| == Physical Plan ==
+*(1) ColumnarToRow
++- FileScan parquet default.emp[id#0] Batched: true, DataFilters: [], Format: 
Parquet, Location: 
InMemoryFileIndex[file:/home/root1/Spark/spark/spark-warehouse/emp], 
PartitionFilters: [], PushedFilters: [], ReadSchema: struct
+
+ |
+++
+
+
+-- Using CODEGEN
+
+EXPLAIN CODEGEN select * from emp;
+++
+|plan|
+++
+| Found 1 WholeStageCodegen subtrees.
+== Subtree 1 / 1 (maxMethodCodeSize:192; maxConstantPoolSize:127(0.19% used); 
numInnerClasses:0) ==
+*(1) ColumnarToRow
++- FileScan parquet default.emp[id#0] Batched: true, DataFilters: [], Format: 
Parquet, Location: 
InMemoryFileIndex[file:/home/root1/Spark/spark/spark-warehouse/emp], 
PartitionFilters: [], PushedFilters: [], ReadSchema: struct
+
+Generated code:
 
 Review comment:
   This description looks verbose to me and the codegen mode is mainly for 
advanced users. So, I think its less worth printing this and the other examples 
(e.g., `EXTENDED` and `FORMATTED`) are enough for documents. WDYT?


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] [spark] maropu commented on a change in pull request #26970: [SPARK-28825][SQL][DOC] Documentation for Explain Command

2019-12-20 Thread GitBox
maropu commented on a change in pull request #26970: [SPARK-28825][SQL][DOC] 
Documentation for Explain Command
URL: https://github.com/apache/spark/pull/26970#discussion_r360622819
 
 

 ##
 File path: docs/sql-ref-syntax-qry-explain.md
 ##
 @@ -19,4 +19,157 @@ license: |
   limitations under the License.
 ---
 
-**This page is under construction**
+### Description
+
+The `EXPLAIN` statement provides the execution plan for the statement. 
+By default, `EXPLAIN` provides information about the physical plan.
+`EXPLAIN` does not support 'DESCRIBE TABLE' statement.
+
+
+### Syntax
+{% highlight sql %}
+EXPLAIN [EXTENDED | CODEGEN] statement
 
 Review comment:
   We have more modes for explains:
   
https://github.com/apache/spark/blob/c72f88b0ba20727e831ba9755d9628d0347ee3cb/sql/core/src/main/scala/org/apache/spark/sql/execution/command/commands.scala#L134


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org