allisonwang-db commented on code in PR #37080:
URL: https://github.com/apache/spark/pull/37080#discussion_r918189602


##########
docs/sql-ref-syntax-qry-select-join.md:
##########
@@ -26,7 +26,7 @@ A SQL join is used to combine rows from two relations based 
on join criteria. Th
 ### Syntax
 
 ```sql
-relation { [ join_type ] JOIN relation [ join_criteria ] | NATURAL join_type 
JOIN relation }
+relation { [ join_type ] JOIN [ LATERAL ] relation [ join_criteria ] | NATURAL 
join_type JOIN [ LATERAL ] relation }

Review Comment:
   Should we also update the syntax reference in `sql-ref-syntax-qry-select.md` 
under the `from_item`:
   `[LATERAL] (subquery)`?



##########
docs/sql-ref-syntax-qry-select-lateral-subquery.md:
##########
@@ -0,0 +1,87 @@
+---
+layout: global
+title: LATERAL SUBQUERY
+displayTitle: LATERAL SUBQUERY
+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 SUBQUERY` is a subquery that is preceded by the keyword `LATERAL`. It 
provides a way to cross-reference columns in the preceding FROM clause.

Review Comment:
   ```suggestion
   `LATERAL SUBQUERY` is a subquery that is preceded by the keyword `LATERAL`. 
It provides a way to reference columns in the preceding `FROM` clause.
   ```



##########
docs/sql-ref-syntax-qry-select-lateral-subquery.md:
##########
@@ -0,0 +1,87 @@
+---
+layout: global
+title: LATERAL SUBQUERY
+displayTitle: LATERAL SUBQUERY
+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 SUBQUERY` is a subquery that is preceded by the keyword `LATERAL`. It 
provides a way to cross-reference columns in the preceding FROM clause.
+Without the `LATERAL` keyword, subqueries can only refer to columns in the 
outer query, but not in the `FROM` clause. `LATERAL SUBQUERY` makes the 
complicated
+queries simpler and more efficient.
+
+### Syntax
+
+```sql
+[ LATERAL ] primary_relation [ join_relation ]
+```
+
+### Parameters
+
+* **primary_relation**
+
+  Specifies the primary relation. It can be one of the following:
+  * Table relation
+  * aliased query
+
+    Syntax: `( query ) [ [ AS ] alias ]`
+  * aliased relation

Review Comment:
   ```suggestion
     * Aliased relation
   ```



##########
docs/sql-ref-syntax-qry-select-lateral-subquery.md:
##########
@@ -0,0 +1,87 @@
+---
+layout: global
+title: LATERAL SUBQUERY
+displayTitle: LATERAL SUBQUERY
+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 SUBQUERY` is a subquery that is preceded by the keyword `LATERAL`. It 
provides a way to cross-reference columns in the preceding FROM clause.
+Without the `LATERAL` keyword, subqueries can only refer to columns in the 
outer query, but not in the `FROM` clause. `LATERAL SUBQUERY` makes the 
complicated
+queries simpler and more efficient.
+
+### Syntax
+
+```sql
+[ LATERAL ] primary_relation [ join_relation ]
+```
+
+### Parameters
+
+* **primary_relation**
+
+  Specifies the primary relation. It can be one of the following:
+  * Table relation
+  * aliased query

Review Comment:
   ```suggestion
     * Aliased 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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to