huaxingao commented on a change in pull request #29056:
URL: https://github.com/apache/spark/pull/29056#discussion_r456716781



##########
File path: docs/sql-ref-syntax-qry-select-lateral-view.md
##########
@@ -0,0 +1,130 @@
+---
+layout: global
+title: LATERAL VIEW Clause
+displayTitle: LATERAL VIEW Clause
+license: |
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+---
+
+### Description
+
+`LATERAL VIEW` clause is used in conjunction with generator functions such as 
explode(), which will generate a virtual table containing one or more rows. 
`LATERAL VIEW` will apply the rows to each original output row.
+
+### Syntax
+
+```sql
+LATERAL VIEW [ OUTER ] generator_function ( expression [ , ... ] ) [ 
table_alias ] AS column_alias [ , ... ]
+```
+
+### Parameters
+
+* **OUTER**
+
+    If `LATERAL VIEW` is used without `OUTER`, and `generator_function` 
returns empty, then no results will be output in `SELECT` clause.
+    If `LATERAL VIEW` is used with `OUTER`, and `generator_function` returns 
empty, then results will be output normally with `NULL` as `generator_function` 
output.  .

Review comment:
       super nit: there is an extra . in the end.

##########
File path: docs/sql-ref-syntax-qry-select-pivot.md
##########
@@ -0,0 +1,100 @@
+---
+layout: global
+title: PIVOT Clause
+displayTitle: PIVOT Clause
+license: |
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+---
+
+### Description
+
+`PIVOT` clause is used for data perspective, we can get the aggregated values 
based on specific column value.
+
+### Syntax
+
+```sql
+PIVOT ( { aggregate_expression [ AS aggregate_expression_alias ] } [ , ... ] 
FOR column_list IN ( expression_list ) )
+```
+
+### Parameters
+    
+* **aggregate_expression**
+
+    Specifies an aggregate expression (SUM(a), COUNT(DISTINCT b), etc.).
+    
+* **aggregate_expression_alias**
+
+    Specifies an alias for aggregate expression.
+     
+* **column_list**
+
+    It contains columns in the `FROM` clause, which specific the columns we 
want to replaced with new columns, we can use brackets to surround the columns, 
such as `( c1, c2 )`.
+      
+* **expression_list**
+
+    It specifics new columns, which used to match values in `column_List` as 
the aggregating condition, we can also add alias for them.

Review comment:
       specifics -> specifies

##########
File path: docs/sql-ref-syntax-qry-select-pivot.md
##########
@@ -0,0 +1,100 @@
+---
+layout: global
+title: PIVOT Clause
+displayTitle: PIVOT Clause
+license: |
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+---
+
+### Description
+
+`PIVOT` clause is used for data perspective, we can get the aggregated values 
based on specific column value.
+
+### Syntax
+
+```sql
+PIVOT ( { aggregate_expression [ AS aggregate_expression_alias ] } [ , ... ] 
FOR column_list IN ( expression_list ) )

Review comment:
       You probably need to break this into two lines. It looks like this in my 
browser:
   
   <img width="847" alt="Screen Shot 2020-07-17 at 4 50 38 PM" 
src="https://user-images.githubusercontent.com/13592258/87839015-e0eeba00-c84d-11ea-82d2-61e2f7ec396f.png";>
   

##########
File path: docs/sql-ref-syntax-qry-select-pivot.md
##########
@@ -0,0 +1,100 @@
+---
+layout: global
+title: PIVOT Clause
+displayTitle: PIVOT Clause
+license: |
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+---
+
+### Description
+
+`PIVOT` clause is used for data perspective, we can get the aggregated values 
based on specific column value.
+
+### Syntax
+
+```sql
+PIVOT ( { aggregate_expression [ AS aggregate_expression_alias ] } [ , ... ] 
FOR column_list IN ( expression_list ) )
+```
+
+### Parameters
+    
+* **aggregate_expression**
+
+    Specifies an aggregate expression (SUM(a), COUNT(DISTINCT b), etc.).
+    
+* **aggregate_expression_alias**
+
+    Specifies an alias for aggregate expression.
+     
+* **column_list**
+
+    It contains columns in the `FROM` clause, which specific the columns we 
want to replaced with new columns, we can use brackets to surround the columns, 
such as `( c1, c2 )`.

Review comment:
       specific -> specifies?

##########
File path: docs/sql-ref-syntax-qry-select-pivot.md
##########
@@ -0,0 +1,100 @@
+---
+layout: global
+title: PIVOT Clause
+displayTitle: PIVOT Clause
+license: |
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+---
+
+### Description
+
+`PIVOT` clause is used for data perspective, we can get the aggregated values 
based on specific column value.

Review comment:
       Maybe add a little more description? 
   Here is one example 
https://docs.snowflake.com/en/sql-reference/constructs/pivot.html#




----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to