[GitHub] [spark] kevinyu98 commented on a change in pull request #25573: [SPARK-28833][DOCS][SQL] Document ALTER VIEW command

2019-11-13 Thread GitBox
kevinyu98 commented on a change in pull request #25573: 
[SPARK-28833][DOCS][SQL] Document ALTER VIEW command
URL: https://github.com/apache/spark/pull/25573#discussion_r346150272
 
 

 ##
 File path: docs/sql-ref-syntax-ddl-alter-view.md
 ##
 @@ -19,4 +19,222 @@ license: |
   limitations under the License.
 ---
 
-**This page is under construction**
+### Description
+
+The `ALTER VIEW` statement can alter metadata associated with the view. It can 
change the definition of the view, change
+the name of a view to a different name, set and unset the metadata of the view 
by setting `TBLPROPERTIES`.
+
+ RENAME View
+Renames the existing view. If the new view name already exists in the source 
database, a `TableAlreadyExistsException` is thrown. This operation
+does not support moving the views across databases.
+
+ Syntax
+{% highlight sql %}
+ALTER VIEW view_identifier RENAME TO view_identifier
+{% endhighlight %}
+
+ Parameters
+
+  view_identifier
+  
+Specifies a view name, which may be optionally qualified with a database 
name.
+ Syntax:
+  
+[database_name.]view_name
+  
+  
+
+
+ SET View Properties
+Set one or more properties of an existing view. The properties are the key 
value pairs. If the properties' keys exist, 
+the values are replaced with the new values. If the properties' keys do not 
exist, the key value pairs are added into
+the properties.
+
+ Syntax
+{% highlight sql %}
+ALTER VIEW view_identifier SET TBLPROPERTIES
+  (property_key=property_val [, ...])
+{% endhighlight %}
+
+ Parameters
+
+  view_identifier
+  
+Specifies a view name, which may be optionally qualified with a database 
name.
+ Syntax:
+  
+[database_name.]view_name
+  
+  
+  property_key
+  
+Specifies the property key. The key may consists of multiple parts 
separated by dot.
+Syntax:
+  
+[key_part1][.key_part2][...]
+  
+  
+
+
+ UNSET View Properties
+Drop one or more properties of an existing view. If the specified keys do not 
exist, an exception is thrown. Use 
+`IF EXISTS` to avoid the exception. 
+
+ Syntax
+{% highlight sql %}
+ALTER VIEW view_identifier UNSET TBLPROPERTIES [IF EXISTS]
+  (property_key [, ...])
+{% endhighlight %}
+
+ Parameters
+
+  view_identifier
+  
+Specifies a view name, which may be optionally qualified with a database 
name.
+ Syntax:
+  
+[database_name.]view_name
+  
+  
+  property_key
+  
+Specifies the property key. The key may consists of multiple parts 
separated by dot.
+Syntax:
+  
+[key_part1][.key_part2][...]
+  
+  
+
+
+ ALTER View AS SELECT
+`ALTER VIEW view_identifier AS SELECT` statement changes the definition of a 
view, the `SELECT` statement must be valid,
+and the `view_identifier` must exist.
+
+ Syntax
+{% highlight sql %}
+ALTER VIEW view_identifier AS select_statement
+{% endhighlight %}
+
+ Parameters
+
+  view_identifier
+  
+Specifies a view name, which may be optionally qualified with a database 
name.
+ Syntax:
+  
+[database_name.]view_name
+  
+  
+  select_statement
+  
+Specifies the definition of the view, detail check 
[select_statement](sql-ref-syntax-qry-select.html)
+  
+
+
+### Examples
+
+{% highlight sql %}
+-- Rename only changes the view name.
+-- The source and target databases of the view have to be the same.
+-- Use qualified or unqualified name for the source and target view  
+ALTER VIEW tempdb1.v1 RENAME TO tempdb1.v2;
+
+-- Verify that the new view is created.
+DESCRIBE TABLE EXTENDED tempdb1.v2;
+
+++--+---+
+|col_name|data_type |comment|
+++--+---+
+|c1  |int   |null   |
+|c2  |string|null   |
+||  |   |
+|# Detailed Table Information|  |   |
+|Database|tempdb1   |   |
+|Table   |v2|   |
+++--+---+
+
+-- Use `DESC TABLE EXTENDED tempdb1.v2` before and after the `ALTER VIEW` 
statement to verify the changes.
 
 Review comment:
   Thanks, changed.


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] kevinyu98 commented on a change in pull request #25573: [SPARK-28833][DOCS][SQL] Document ALTER VIEW command

2019-11-13 Thread GitBox
kevinyu98 commented on a change in pull request #25573: 
[SPARK-28833][DOCS][SQL] Document ALTER VIEW command
URL: https://github.com/apache/spark/pull/25573#discussion_r345923078
 
 

 ##
 File path: docs/sql-ref-syntax-ddl-alter-view.md
 ##
 @@ -19,4 +19,222 @@ license: |
   limitations under the License.
 ---
 
-**This page is under construction**
+### Description
+
+The `ALTER VIEW` statement can alter metadata associated with the view. It can 
change the definition of the view, change
+the name of a view to a different name, set and unset the metadata of the view 
by setting `TBLPROPERTIES`.
+
+ RENAME View
+Renames the existing view. If the new view name already exists in the source 
database, a `TableAlreadyExistsException` is thrown. This operation
+does not support moving the views across databases.
+
+ Syntax
+{% highlight sql %}
+ALTER VIEW view_identifier RENAME TO view_identifier
+{% endhighlight %}
+
+ Parameters
+
+  view_identifier
+  
+Specifies a view name, which may be optionally qualified with a database 
name.
+ Syntax:
+  
+[database_name.]view_name
+  
+  
+
+
+ SET View Properties
+Set one or more properties of an existing view. The properties are the key 
value pairs. If the properties' keys exist, 
+the values are replaced with the new values. If the properties' keys do not 
exist, the key value pairs are added into
+the properties.
+
+ Syntax
+{% highlight sql %}
+ALTER VIEW view_identifier SET TBLPROPERTIES
+  (property_key=property_val [, ...])
+{% endhighlight %}
+
+ Parameters
+
+  view_identifier
+  
+Specifies a view name, which may be optionally qualified with a database 
name.
+ Syntax:
+  
+[database_name.]view_name
+  
+  
+  property_key
+  
+Specifies the property key. The key may consists of multiple parts 
separated by dot.
+Syntax:
+  
+[key_part1][.key_part2][...]
+  
+  
+
+
+ UNSET View Properties
+Drop one or more properties of an existing view. If the specified keys do not 
exist, an exception is thrown. Use 
+`IF EXISTS` to avoid the exception. 
+
+ Syntax
+{% highlight sql %}
+ALTER VIEW view_identifier UNSET TBLPROPERTIES [IF EXISTS]
+  (property_key [, ...])
+{% endhighlight %}
+
+ Parameters
+
+  view_identifier
+  
+Specifies a view name, which may be optionally qualified with a database 
name.
+ Syntax:
+  
+[database_name.]view_name
+  
+  
+  property_key
+  
+Specifies the property key. The key may consists of multiple parts 
separated by dot.
+Syntax:
+  
+[key_part1][.key_part2][...]
+  
+  
+
+
+ ALTER View AS SELECT
+`ALTER VIEW view_identifier AS SELECT` statement changes the definition of a 
view, the `SELECT` statement must be valid,
+and the `view_identifier` must exist.
+
+ Syntax
+{% highlight sql %}
+ALTER VIEW view_identifier AS select_statement
+{% endhighlight %}
+
+ Parameters
+
+  view_identifier
+  
+Specifies a view name, which may be optionally qualified with a database 
name.
+ Syntax:
+  
+[database_name.]view_name
+  
+  
+  select_statement
+  
+Specifies the definition of the view, detail check 
[select_statement](sql-ref-syntax-qry-select.html)
 
 Review comment:
   @huaxingao thanks, let me change.


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] kevinyu98 commented on a change in pull request #25573: [SPARK-28833][DOCS][SQL] Document ALTER VIEW command

2019-11-11 Thread GitBox
kevinyu98 commented on a change in pull request #25573: 
[SPARK-28833][DOCS][SQL] Document ALTER VIEW command
URL: https://github.com/apache/spark/pull/25573#discussion_r344859398
 
 

 ##
 File path: docs/sql-ref-syntax-ddl-alter-view.md
 ##
 @@ -19,4 +19,217 @@ license: |
   limitations under the License.
 ---
 
-**This page is under construction**
+### Description
+The `ALTER VIEW` statement can alter metadata associated with the view. It can 
change the definition of the view, change
+the name of a view to a different name, set and unset the metadata of the view 
by setting `TBLPROPERTIES`.
+
+ Rename VIEW
+Renames the existing view. If the view name already exists in the source 
database, a TableAlreadyExistsException is thrown. This operation
+does not support moving the views cross databases.
+
+# Syntax
+{% highlight sql %}
+ALTER VIEW view_identifier RENAME TO view_identifier
+{% endhighlight %}
+
+# Parameters
+
+  view_identifier
+  
+Specifies a view name, which may be optionally qualified with a database 
name.
+ Syntax:
+  
+[database_name.]view_name
+  
+  
+
+
+ Set VIEW Properties
+Set one or more properties of an existing view. The properties are the key 
value pairs. If the properties' keys exist, 
+the values are replaced with the new values. If the properties' keys do not 
exist, the key value pairs are added into
+the properties.
+
+# Syntax
+{% highlight sql %}
+ALTER VIEW view_identifier SET TBLPROPERTIES
+  (property_key=property_val [, ...])
+{% endhighlight %}
+
+# Parameters
+
+  view_identifier
+  
+Specifies a view name, which may be optionally qualified with a database 
name.
+ Syntax:
+  
+[database_name.]view_name
+  
+  
+  property_key
+  
+Specifies the property key. The key may consists of multiple parts 
separated by dot.
+Syntax:
+  
+[key_part1][.key_part2][...]
+  
+  
+
+
+ Drop VIEW properties
 
 Review comment:
   


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] kevinyu98 commented on a change in pull request #25573: [SPARK-28833][DOCS][SQL] Document ALTER VIEW command

2019-11-11 Thread GitBox
kevinyu98 commented on a change in pull request #25573: 
[SPARK-28833][DOCS][SQL] Document ALTER VIEW command
URL: https://github.com/apache/spark/pull/25573#discussion_r344859255
 
 

 ##
 File path: docs/sql-ref-syntax-ddl-alter-view.md
 ##
 @@ -19,4 +19,217 @@ license: |
   limitations under the License.
 ---
 
-**This page is under construction**
+### Description
+The `ALTER VIEW` statement can alter metadata associated with the view. It can 
change the definition of the view, change
+the name of a view to a different name, set and unset the metadata of the view 
by setting `TBLPROPERTIES`.
+
+ Rename VIEW
+Renames the existing view. If the view name already exists in the source 
database, a TableAlreadyExistsException is thrown. This operation
 
 Review comment:
   


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] kevinyu98 commented on a change in pull request #25573: [SPARK-28833][DOCS][SQL] Document ALTER VIEW command

2019-11-11 Thread GitBox
kevinyu98 commented on a change in pull request #25573: 
[SPARK-28833][DOCS][SQL] Document ALTER VIEW command
URL: https://github.com/apache/spark/pull/25573#discussion_r344849290
 
 

 ##
 File path: docs/sql-ref-syntax-ddl-alter-view.md
 ##
 @@ -19,4 +19,217 @@ license: |
   limitations under the License.
 ---
 
-**This page is under construction**
+### Description
+The `ALTER VIEW` statement can alter metadata associated with the view. It can 
change the definition of the view, change
+the name of a view to a different name, set and unset the metadata of the view 
by setting `TBLPROPERTIES`.
+
+ Rename VIEW
 
 Review comment:
   ok


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] kevinyu98 commented on a change in pull request #25573: [SPARK-28833][DOCS][SQL] Document ALTER VIEW command

2019-11-11 Thread GitBox
kevinyu98 commented on a change in pull request #25573: 
[SPARK-28833][DOCS][SQL] Document ALTER VIEW command
URL: https://github.com/apache/spark/pull/25573#discussion_r344849321
 
 

 ##
 File path: docs/sql-ref-syntax-ddl-alter-view.md
 ##
 @@ -19,4 +19,217 @@ license: |
   limitations under the License.
 ---
 
-**This page is under construction**
+### Description
+The `ALTER VIEW` statement can alter metadata associated with the view. It can 
change the definition of the view, change
+the name of a view to a different name, set and unset the metadata of the view 
by setting `TBLPROPERTIES`.
+
+ Rename VIEW
+Renames the existing view. If the view name already exists in the source 
database, a TableAlreadyExistsException is thrown. This operation
+does not support moving the views cross databases.
+
+# Syntax
+{% highlight sql %}
+ALTER VIEW view_identifier RENAME TO view_identifier
+{% endhighlight %}
+
+# Parameters
+
+  view_identifier
+  
+Specifies a view name, which may be optionally qualified with a database 
name.
+ Syntax:
+  
+[database_name.]view_name
+  
+  
+
+
+ Set VIEW Properties
+Set one or more properties of an existing view. The properties are the key 
value pairs. If the properties' keys exist, 
+the values are replaced with the new values. If the properties' keys do not 
exist, the key value pairs are added into
+the properties.
+
+# Syntax
+{% highlight sql %}
+ALTER VIEW view_identifier SET TBLPROPERTIES
+  (property_key=property_val [, ...])
+{% endhighlight %}
+
+# Parameters
+
+  view_identifier
+  
+Specifies a view name, which may be optionally qualified with a database 
name.
+ Syntax:
+  
+[database_name.]view_name
+  
+  
+  property_key
+  
+Specifies the property key. The key may consists of multiple parts 
separated by dot.
+Syntax:
+  
+[key_part1][.key_part2][...]
+  
+  
+
+
+ Drop VIEW properties
+Drop one or more properties of an existing view. If the specified keys do not 
exist, an exception is thrown. Use 
+`IF EXISTS` to avoid the exception. 
+
+# Syntax
+{% highlight sql %}
+ALTER VIEW view_identifier UNSET TBLPROPERTIES [IF EXISTS]
+  (property_key [, ...])
+{% endhighlight %}
+
+# Parameters
+
+  view_identifier
+  
+Specifies a view name, which may be optionally qualified with a database 
name.
+ Syntax:
+  
+[database_name.]view_name
+  
+  
+  property_key
+  
+Specifies the property key. The key may consists of multiple parts 
separated by dot.
+Syntax:
+  
+[key_part1][.key_part2][...]
+  
+  
+
+
+ Alter VIEW As Select
+`ALTER VIEW view_identifier AS SELECT` statement changes the definition of a 
view, the `SELECT` statement must be valid,
+and the `view_identifier` must exist.
+
+# Syntax
+{% highlight sql %}
+ALTER VIEW view_identifier AS select_statement
+{% endhighlight %}
+
+# Parameters
+
+  view_identifier
+  
+Specifies a view name, which may be optionally qualified with a database 
name.
+ Syntax:
+  
+[database_name.]view_name
+  
+  
+  select_statement
+  
+Specifies the definition of the view, detail check 
[select_statement](sql-ref-syntax-qry-select.html)
+  
+
+
+ Examples
+{% highlight sql %}
+-- Rename only changes the view name.
+-- The source and target databases of the view have to be the same, use 
qualified or unqualified name for the target view  
+ALTER VIEW tempdb1.v1 RENAME TO v2;
+
+-- Verify that the new view is created.
+DESCRIBE TABLE EXTENDED tempdb1.v2;
+
+++--+---+
+|col_name|data_type |comment|
+++--+---+
+|c1  |int   |null   |
+|c2  |string|null   |
+||  |   |
+|# Detailed Table Information|  |   |
+|Database|tempdb1   |   |
+|Table   |v2|   |
+++--+---+
+
+-- Use `DESC TABLE EXTENDED tempdb1.v2` before and after the `ALTER VIEW` 
statement to verify the changes.
+-- Before ALTER VIEW SET TBLPROPERTIES
+DESC TABLE EXTENDED tempdb1.v2;
+
+++--+---+
+|col_name|data_type |comment|
+++--+---+
+|c1  |int   |null   |
+|c2  |string|null   |
+||  |   |
+|# Detailed Table Information|  |   |
+|Database|tempdb1   |   |
+|Table   |v2|   |
+|Table Properties|[]|   |
+++--+---+
+
+-- Set properties in TBLPROPERTIES
+ALTER VIEW tempdb1.v2 SET TBLPROPERTIES ('created.by.user' = "John", 

[GitHub] [spark] kevinyu98 commented on a change in pull request #25573: [SPARK-28833][DOCS][SQL] Document ALTER VIEW command

2019-11-11 Thread GitBox
kevinyu98 commented on a change in pull request #25573: 
[SPARK-28833][DOCS][SQL] Document ALTER VIEW command
URL: https://github.com/apache/spark/pull/25573#discussion_r344843160
 
 

 ##
 File path: docs/sql-ref-syntax-ddl-alter-view.md
 ##
 @@ -19,4 +19,217 @@ license: |
   limitations under the License.
 ---
 
-**This page is under construction**
+### Description
 
 Review comment:
   ok, I will add a blank line for the same level of section as `### 
Description`


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] kevinyu98 commented on a change in pull request #25573: [SPARK-28833][DOCS][SQL] Document ALTER VIEW command

2019-11-11 Thread GitBox
kevinyu98 commented on a change in pull request #25573: 
[SPARK-28833][DOCS][SQL] Document ALTER VIEW command
URL: https://github.com/apache/spark/pull/25573#discussion_r344804735
 
 

 ##
 File path: docs/sql-ref-syntax-ddl-alter-view.md
 ##
 @@ -19,4 +19,217 @@ license: |
   limitations under the License.
 ---
 
-**This page is under construction**
+### Description
+The `ALTER VIEW` statement can alter metadata associated with the view. It can 
change the definition of the view, change
+the name of a view to a different name, set and unset the metadata of the view 
by setting `TBLPROPERTIES`.
+
+ Rename VIEW
+Renames the existing view. If the view name already exists in the source 
database, a TableAlreadyExistsException is thrown. This operation
+does not support moving the views cross databases.
+
+# Syntax
+{% highlight sql %}
+ALTER VIEW view_identifier RENAME TO view_identifier
+{% endhighlight %}
+
+# Parameters
+
+  view_identifier
+  
+Specifies a view name, which may be optionally qualified with a database 
name.
+ Syntax:
+  
+[database_name.]view_name
+  
+  
+
+
+ Set VIEW Properties
+Set one or more properties of an existing view. The properties are the key 
value pairs. If the properties' keys exist, 
+the values are replaced with the new values. If the properties' keys do not 
exist, the key value pairs are added into
+the properties.
+
+# Syntax
+{% highlight sql %}
+ALTER VIEW view_identifier SET TBLPROPERTIES
+  (property_key=property_val [, ...])
+{% endhighlight %}
+
+# Parameters
+
+  view_identifier
+  
+Specifies a view name, which may be optionally qualified with a database 
name.
+ Syntax:
+  
+[database_name.]view_name
+  
+  
+  property_key
+  
+Specifies the property key. The key may consists of multiple parts 
separated by dot.
+Syntax:
+  
+[key_part1][.key_part2][...]
+  
+  
+
+
+ Drop VIEW properties
+Drop one or more properties of an existing view. If the specified keys do not 
exist, an exception is thrown. Use 
+`IF EXISTS` to avoid the exception. 
+
+# Syntax
+{% highlight sql %}
+ALTER VIEW view_identifier UNSET TBLPROPERTIES [IF EXISTS]
+  (property_key [, ...])
+{% endhighlight %}
+
+# Parameters
+
+  view_identifier
+  
+Specifies a view name, which may be optionally qualified with a database 
name.
+ Syntax:
+  
+[database_name.]view_name
+  
+  
+  property_key
+  
+Specifies the property key. The key may consists of multiple parts 
separated by dot.
+Syntax:
+  
+[key_part1][.key_part2][...]
+  
+  
+
+
+ Alter VIEW As Select
+`ALTER VIEW view_identifier AS SELECT` statement changes the definition of a 
view, the `SELECT` statement must be valid,
+and the `view_identifier` must exist.
+
+# Syntax
+{% highlight sql %}
+ALTER VIEW view_identifier AS select_statement
+{% endhighlight %}
+
+# Parameters
+
+  view_identifier
+  
+Specifies a view name, which may be optionally qualified with a database 
name.
+ Syntax:
+  
+[database_name.]view_name
+  
+  
+  select_statement
+  
+Specifies the definition of the view, detail check 
[select_statement](sql-ref-syntax-qry-select.html)
+  
+
+
+ Examples
+{% highlight sql %}
+-- Rename only changes the view name.
+-- The source and target databases of the view have to be the same, use 
qualified or unqualified name for the target view  
 
 Review comment:
   ok


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] kevinyu98 commented on a change in pull request #25573: [SPARK-28833][DOCS][SQL] Document ALTER VIEW command

2019-11-11 Thread GitBox
kevinyu98 commented on a change in pull request #25573: 
[SPARK-28833][DOCS][SQL] Document ALTER VIEW command
URL: https://github.com/apache/spark/pull/25573#discussion_r344803018
 
 

 ##
 File path: docs/sql-ref-syntax-ddl-alter-view.md
 ##
 @@ -19,4 +19,217 @@ license: |
   limitations under the License.
 ---
 
-**This page is under construction**
+### Description
+The `ALTER VIEW` statement can alter metadata associated with the view. It can 
change the definition of the view, change
+the name of a view to a different name, set and unset the metadata of the view 
by setting `TBLPROPERTIES`.
+
+ Rename VIEW
+Renames the existing view. If the view name already exists in the source 
database, a TableAlreadyExistsException is thrown. This operation
 
 Review comment:
   


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] kevinyu98 commented on a change in pull request #25573: [SPARK-28833][DOCS][SQL] Document ALTER VIEW command

2019-11-11 Thread GitBox
kevinyu98 commented on a change in pull request #25573: 
[SPARK-28833][DOCS][SQL] Document ALTER VIEW command
URL: https://github.com/apache/spark/pull/25573#discussion_r344803205
 
 

 ##
 File path: docs/sql-ref-syntax-ddl-alter-view.md
 ##
 @@ -19,4 +19,217 @@ license: |
   limitations under the License.
 ---
 
-**This page is under construction**
+### Description
+The `ALTER VIEW` statement can alter metadata associated with the view. It can 
change the definition of the view, change
+the name of a view to a different name, set and unset the metadata of the view 
by setting `TBLPROPERTIES`.
+
+ Rename VIEW
+Renames the existing view. If the view name already exists in the source 
database, a TableAlreadyExistsException is thrown. This operation
+does not support moving the views cross databases.
 
 Review comment:
   


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] kevinyu98 commented on a change in pull request #25573: [SPARK-28833][DOCS][SQL] Document ALTER VIEW command

2019-11-10 Thread GitBox
kevinyu98 commented on a change in pull request #25573: 
[SPARK-28833][DOCS][SQL] Document ALTER VIEW command
URL: https://github.com/apache/spark/pull/25573#discussion_r344536769
 
 

 ##
 File path: docs/sql-ref-syntax-ddl-alter-view.md
 ##
 @@ -19,4 +19,78 @@ license: |
   limitations under the License.
 ---
 
-**This page is under construction**
+### Description
+The `ALTER VIEW` statement changes various auxiliary properties of a view.
+
+
+ Rename view
+Rename the existing view. If the view name already exists in the database, an 
exception is thrown. This operation does 
+support moving the views cross databases. 
+# Syntax
+{% highlight sql %}
+ALTER VIEW viewIdentifier RENAME TO viewIdentifier
+viewIdentifier:= [db_name.]view_name
+{% endhighlight %}
+
+
+ Set view properties
+Set one or more properties of an existing view. The properties are the key 
value pairs. If the properties' keys exist, 
+the values are replaced with the new values. If the properties' keys does not 
exist, the key value pairs are added into 
+the properties.
+# Syntax
+{% highlight sql %}
+ALTER VIEW viewIdentifier SET TBLPROPERTIES (key1=val1, key2=val2, ...)
+viewIdentifier:= [db_name.]view_name
+{% endhighlight %}
+
+
+ Drop view properties
+Drop one or more properties of an existing view. If the specified keys do not 
exist, an exception is thrown. Use 
+`IF EXISTS` to avoid the exception. 
+# Syntax
+{% highlight sql %}
+ALTER VIEW viewIdentifier UNSET TBLPROPERTIES [IF EXISTS] (key1=val1, 
key2=val2, ...)
+viewIdentifier:= [db_name.]view_name
+{% endhighlight %}
+
+
+ Alter View As Select
+`ALTER VIEW AS SELECT` statement changes the definition of a view, the 
`select_statement` must valid, and the `VIEW` 
 
 Review comment:
   ok


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] kevinyu98 commented on a change in pull request #25573: [SPARK-28833][DOCS][SQL] Document ALTER VIEW command

2019-11-09 Thread GitBox
kevinyu98 commented on a change in pull request #25573: 
[SPARK-28833][DOCS][SQL] Document ALTER VIEW command
URL: https://github.com/apache/spark/pull/25573#discussion_r344475265
 
 

 ##
 File path: docs/sql-ref-syntax-ddl-alter-view.md
 ##
 @@ -19,4 +19,78 @@ license: |
   limitations under the License.
 ---
 
-**This page is under construction**
+### Description
+The `ALTER VIEW` statement changes various auxiliary properties of a view.
+
+
+ Rename view
+Rename the existing view. If the view name already exists in the database, an 
exception is thrown. This operation does 
+support moving the views cross databases. 
+# Syntax
+{% highlight sql %}
+ALTER VIEW viewIdentifier RENAME TO viewIdentifier
+viewIdentifier:= [db_name.]view_name
+{% endhighlight %}
+
+
+ Set view properties
+Set one or more properties of an existing view. The properties are the key 
value pairs. If the properties' keys exist, 
+the values are replaced with the new values. If the properties' keys does not 
exist, the key value pairs are added into 
+the properties.
+# Syntax
+{% highlight sql %}
+ALTER VIEW viewIdentifier SET TBLPROPERTIES (key1=val1, key2=val2, ...)
+viewIdentifier:= [db_name.]view_name
+{% endhighlight %}
+
+
+ Drop view properties
+Drop one or more properties of an existing view. If the specified keys do not 
exist, an exception is thrown. Use 
+`IF EXISTS` to avoid the exception. 
+# Syntax
+{% highlight sql %}
+ALTER VIEW viewIdentifier UNSET TBLPROPERTIES [IF EXISTS] (key1=val1, 
key2=val2, ...)
+viewIdentifier:= [db_name.]view_name
+{% endhighlight %}
+
+
+ Alter View As Select
+`ALTER VIEW AS SELECT` statement changes the definition of a view, the 
`select_statement` must valid, and the `VIEW` 
+must exist.
+# Syntax
+{% highlight sql %}
+ALTER VIEW viewIdentifier AS select_statement
+viewIdentifier:= [db_name.]view_name
+select_statement:= [select_statement](sql-ref-syntax-qry-select.html)
+{% endhighlight %}
+
+
+ Example
+{% highlight sql %}
+-- Rename only change the view name.
+-- The source and target databases of the view have to be the same, use 
qualified or unqualified name for the target view  
+ALTER VIEW tempdb.view1 RENAME TO view2
+{% endhighlight %}
+
+{% highlight sql %}
+-- Use `DESC TABLE EXTENDED tempdb.view1` before and after the `ALTER VIEW` 
statement to verify the changes.
+ALTER VIEW tempdb.view1 SET TBLPROPERTIES ('propKey1' = "propVal1", 'propKey2' 
= "propVal2" )
+{% endhighlight %}
+
+{% highlight sql %}
+-- Use `DESC TABLE EXTENDED tempdb.view1` before and after the `ALTER VIEW` to 
verify the change.
+ALTER VIEW tempdb.view1 UNSET TBLPROPERTIES ('propKey1')
+{% endhighlight %}
+
+{% highlight sql %}
+-- Do the select on tempdb.view1 before and after the `ALTER VIEW` statement 
to verify.
+ALTER VIEW tempdb.view1 AS SELECT * FROM tempdb.view2
+{% endhighlight %}
+
+ Related Statements
+[describe-table](sql-ref-syntax-aux-describe-table.html) 
+[create-view](sql-ref-syntax-ddl-create-view.html)
+[drop-view](sql-ref-syntax-ddl-drop-view.html)
 
 Review comment:
   


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] kevinyu98 commented on a change in pull request #25573: [SPARK-28833][DOCS][SQL] Document ALTER VIEW command

2019-11-09 Thread GitBox
kevinyu98 commented on a change in pull request #25573: 
[SPARK-28833][DOCS][SQL] Document ALTER VIEW command
URL: https://github.com/apache/spark/pull/25573#discussion_r344475219
 
 

 ##
 File path: docs/sql-ref-syntax-ddl-alter-view.md
 ##
 @@ -19,4 +19,78 @@ license: |
   limitations under the License.
 ---
 
-**This page is under construction**
+### Description
+The `ALTER VIEW` statement changes various auxiliary properties of a view.
+
+
+ Rename view
+Rename the existing view. If the view name already exists in the database, an 
exception is thrown. This operation does 
+support moving the views cross databases. 
+# Syntax
+{% highlight sql %}
+ALTER VIEW viewIdentifier RENAME TO viewIdentifier
+viewIdentifier:= [db_name.]view_name
+{% endhighlight %}
+
+
+ Set view properties
+Set one or more properties of an existing view. The properties are the key 
value pairs. If the properties' keys exist, 
+the values are replaced with the new values. If the properties' keys does not 
exist, the key value pairs are added into 
+the properties.
+# Syntax
+{% highlight sql %}
+ALTER VIEW viewIdentifier SET TBLPROPERTIES (key1=val1, key2=val2, ...)
+viewIdentifier:= [db_name.]view_name
+{% endhighlight %}
+
+
+ Drop view properties
+Drop one or more properties of an existing view. If the specified keys do not 
exist, an exception is thrown. Use 
+`IF EXISTS` to avoid the exception. 
+# Syntax
+{% highlight sql %}
+ALTER VIEW viewIdentifier UNSET TBLPROPERTIES [IF EXISTS] (key1=val1, 
key2=val2, ...)
+viewIdentifier:= [db_name.]view_name
+{% endhighlight %}
+
+
+ Alter View As Select
+`ALTER VIEW AS SELECT` statement changes the definition of a view, the 
`select_statement` must valid, and the `VIEW` 
+must exist.
+# Syntax
+{% highlight sql %}
+ALTER VIEW viewIdentifier AS select_statement
+viewIdentifier:= [db_name.]view_name
+select_statement:= [select_statement](sql-ref-syntax-qry-select.html)
+{% endhighlight %}
+
+
+ Example
+{% highlight sql %}
+-- Rename only change the view name.
+-- The source and target databases of the view have to be the same, use 
qualified or unqualified name for the target view  
+ALTER VIEW tempdb.view1 RENAME TO view2
+{% endhighlight %}
+
+{% highlight sql %}
+-- Use `DESC TABLE EXTENDED tempdb.view1` before and after the `ALTER VIEW` 
statement to verify the changes.
+ALTER VIEW tempdb.view1 SET TBLPROPERTIES ('propKey1' = "propVal1", 'propKey2' 
= "propVal2" )
+{% endhighlight %}
+
+{% highlight sql %}
+-- Use `DESC TABLE EXTENDED tempdb.view1` before and after the `ALTER VIEW` to 
verify the change.
+ALTER VIEW tempdb.view1 UNSET TBLPROPERTIES ('propKey1')
+{% endhighlight %}
+
+{% highlight sql %}
+-- Do the select on tempdb.view1 before and after the `ALTER VIEW` statement 
to verify.
+ALTER VIEW tempdb.view1 AS SELECT * FROM tempdb.view2
 
 Review comment:
   


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] kevinyu98 commented on a change in pull request #25573: [SPARK-28833][DOCS][SQL] Document ALTER VIEW command

2019-11-09 Thread GitBox
kevinyu98 commented on a change in pull request #25573: 
[SPARK-28833][DOCS][SQL] Document ALTER VIEW command
URL: https://github.com/apache/spark/pull/25573#discussion_r344475211
 
 

 ##
 File path: docs/sql-ref-syntax-ddl-alter-view.md
 ##
 @@ -19,4 +19,78 @@ license: |
   limitations under the License.
 ---
 
-**This page is under construction**
+### Description
+The `ALTER VIEW` statement changes various auxiliary properties of a view.
+
+
+ Rename view
+Rename the existing view. If the view name already exists in the database, an 
exception is thrown. This operation does 
+support moving the views cross databases. 
+# Syntax
+{% highlight sql %}
+ALTER VIEW viewIdentifier RENAME TO viewIdentifier
+viewIdentifier:= [db_name.]view_name
+{% endhighlight %}
+
+
+ Set view properties
+Set one or more properties of an existing view. The properties are the key 
value pairs. If the properties' keys exist, 
+the values are replaced with the new values. If the properties' keys does not 
exist, the key value pairs are added into 
+the properties.
+# Syntax
+{% highlight sql %}
+ALTER VIEW viewIdentifier SET TBLPROPERTIES (key1=val1, key2=val2, ...)
+viewIdentifier:= [db_name.]view_name
+{% endhighlight %}
+
+
+ Drop view properties
+Drop one or more properties of an existing view. If the specified keys do not 
exist, an exception is thrown. Use 
+`IF EXISTS` to avoid the exception. 
+# Syntax
+{% highlight sql %}
+ALTER VIEW viewIdentifier UNSET TBLPROPERTIES [IF EXISTS] (key1=val1, 
key2=val2, ...)
+viewIdentifier:= [db_name.]view_name
+{% endhighlight %}
+
+
+ Alter View As Select
+`ALTER VIEW AS SELECT` statement changes the definition of a view, the 
`select_statement` must valid, and the `VIEW` 
+must exist.
+# Syntax
+{% highlight sql %}
+ALTER VIEW viewIdentifier AS select_statement
+viewIdentifier:= [db_name.]view_name
+select_statement:= [select_statement](sql-ref-syntax-qry-select.html)
+{% endhighlight %}
+
+
+ Example
 
 Review comment:
   


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] kevinyu98 commented on a change in pull request #25573: [SPARK-28833][DOCS][SQL] Document ALTER VIEW command

2019-11-09 Thread GitBox
kevinyu98 commented on a change in pull request #25573: 
[SPARK-28833][DOCS][SQL] Document ALTER VIEW command
URL: https://github.com/apache/spark/pull/25573#discussion_r344475200
 
 

 ##
 File path: docs/sql-ref-syntax-ddl-alter-view.md
 ##
 @@ -19,4 +19,78 @@ license: |
   limitations under the License.
 ---
 
-**This page is under construction**
+### Description
+The `ALTER VIEW` statement changes various auxiliary properties of a view.
+
+
+ Rename view
+Rename the existing view. If the view name already exists in the database, an 
exception is thrown. This operation does 
+support moving the views cross databases. 
+# Syntax
+{% highlight sql %}
+ALTER VIEW viewIdentifier RENAME TO viewIdentifier
+viewIdentifier:= [db_name.]view_name
+{% endhighlight %}
+
+
+ Set view properties
+Set one or more properties of an existing view. The properties are the key 
value pairs. If the properties' keys exist, 
+the values are replaced with the new values. If the properties' keys does not 
exist, the key value pairs are added into 
+the properties.
+# Syntax
+{% highlight sql %}
+ALTER VIEW viewIdentifier SET TBLPROPERTIES (key1=val1, key2=val2, ...)
+viewIdentifier:= [db_name.]view_name
+{% endhighlight %}
+
+
+ Drop view properties
+Drop one or more properties of an existing view. If the specified keys do not 
exist, an exception is thrown. Use 
+`IF EXISTS` to avoid the exception. 
+# Syntax
+{% highlight sql %}
+ALTER VIEW viewIdentifier UNSET TBLPROPERTIES [IF EXISTS] (key1=val1, 
key2=val2, ...)
+viewIdentifier:= [db_name.]view_name
+{% endhighlight %}
+
+
+ Alter View As Select
+`ALTER VIEW AS SELECT` statement changes the definition of a view, the 
`select_statement` must valid, and the `VIEW` 
+must exist.
+# Syntax
+{% highlight sql %}
+ALTER VIEW viewIdentifier AS select_statement
+viewIdentifier:= [db_name.]view_name
+select_statement:= [select_statement](sql-ref-syntax-qry-select.html)
 
 Review comment:
   


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] kevinyu98 commented on a change in pull request #25573: [SPARK-28833][DOCS][SQL] Document ALTER VIEW command

2019-11-09 Thread GitBox
kevinyu98 commented on a change in pull request #25573: 
[SPARK-28833][DOCS][SQL] Document ALTER VIEW command
URL: https://github.com/apache/spark/pull/25573#discussion_r344475176
 
 

 ##
 File path: docs/sql-ref-syntax-ddl-alter-view.md
 ##
 @@ -19,4 +19,78 @@ license: |
   limitations under the License.
 ---
 
-**This page is under construction**
+### Description
+The `ALTER VIEW` statement changes various auxiliary properties of a view.
+
+
+ Rename view
+Rename the existing view. If the view name already exists in the database, an 
exception is thrown. This operation does 
+support moving the views cross databases. 
+# Syntax
+{% highlight sql %}
+ALTER VIEW viewIdentifier RENAME TO viewIdentifier
+viewIdentifier:= [db_name.]view_name
+{% endhighlight %}
+
+
+ Set view properties
+Set one or more properties of an existing view. The properties are the key 
value pairs. If the properties' keys exist, 
+the values are replaced with the new values. If the properties' keys does not 
exist, the key value pairs are added into 
+the properties.
+# Syntax
+{% highlight sql %}
+ALTER VIEW viewIdentifier SET TBLPROPERTIES (key1=val1, key2=val2, ...)
+viewIdentifier:= [db_name.]view_name
+{% endhighlight %}
+
+
+ Drop view properties
+Drop one or more properties of an existing view. If the specified keys do not 
exist, an exception is thrown. Use 
+`IF EXISTS` to avoid the exception. 
+# Syntax
+{% highlight sql %}
+ALTER VIEW viewIdentifier UNSET TBLPROPERTIES [IF EXISTS] (key1=val1, 
key2=val2, ...)
 
 Review comment:
   @srowen you are right, will make change.


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] kevinyu98 commented on a change in pull request #25573: [SPARK-28833][DOCS][SQL] Document ALTER VIEW command

2019-11-08 Thread GitBox
kevinyu98 commented on a change in pull request #25573: 
[SPARK-28833][DOCS][SQL] Document ALTER VIEW command
URL: https://github.com/apache/spark/pull/25573#discussion_r344431503
 
 

 ##
 File path: docs/sql-ref-syntax-ddl-alter-view.md
 ##
 @@ -19,4 +19,78 @@ license: |
   limitations under the License.
 ---
 
-**This page is under construction**
+### Description
+The `ALTER VIEW` statement changes various auxiliary properties of a view.
+
+
+ Rename view
+Rename the existing view. If the view name already exists in the database, an 
exception is thrown. This operation does 
+support moving the views cross databases. 
+# Syntax
+{% highlight sql %}
+ALTER VIEW viewIdentifier RENAME TO viewIdentifier
+viewIdentifier:= [db_name.]view_name
+{% endhighlight %}
+
+
+ Set view properties
+Set one or more properties of an existing view. The properties are the key 
value pairs. If the properties' keys exist, 
+the values are replaced with the new values. If the properties' keys does not 
exist, the key value pairs are added into 
+the properties.
+# Syntax
+{% highlight sql %}
+ALTER VIEW viewIdentifier SET TBLPROPERTIES (key1=val1, key2=val2, ...)
 
 Review comment:
   


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] kevinyu98 commented on a change in pull request #25573: [SPARK-28833][DOCS][SQL] Document ALTER VIEW command

2019-11-08 Thread GitBox
kevinyu98 commented on a change in pull request #25573: 
[SPARK-28833][DOCS][SQL] Document ALTER VIEW command
URL: https://github.com/apache/spark/pull/25573#discussion_r344431095
 
 

 ##
 File path: docs/sql-ref-syntax-ddl-alter-view.md
 ##
 @@ -19,4 +19,78 @@ license: |
   limitations under the License.
 ---
 
-**This page is under construction**
+### Description
+The `ALTER VIEW` statement changes various auxiliary properties of a view.
+
+
+ Rename view
+Rename the existing view. If the view name already exists in the database, an 
exception is thrown. This operation does 
+support moving the views cross databases. 
+# Syntax
+{% highlight sql %}
+ALTER VIEW viewIdentifier RENAME TO viewIdentifier
+viewIdentifier:= [db_name.]view_name
+{% endhighlight %}
+
+
+ Set view properties
+Set one or more properties of an existing view. The properties are the key 
value pairs. If the properties' keys exist, 
+the values are replaced with the new values. If the properties' keys does not 
exist, the key value pairs are added into 
 
 Review comment:
   


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] kevinyu98 commented on a change in pull request #25573: [SPARK-28833][DOCS][SQL] Document ALTER VIEW command

2019-11-08 Thread GitBox
kevinyu98 commented on a change in pull request #25573: 
[SPARK-28833][DOCS][SQL] Document ALTER VIEW command
URL: https://github.com/apache/spark/pull/25573#discussion_r344431070
 
 

 ##
 File path: docs/sql-ref-syntax-ddl-alter-view.md
 ##
 @@ -19,4 +19,78 @@ license: |
   limitations under the License.
 ---
 
-**This page is under construction**
+### Description
+The `ALTER VIEW` statement changes various auxiliary properties of a view.
+
+
+ Rename view
+Rename the existing view. If the view name already exists in the database, an 
exception is thrown. This operation does 
+support moving the views cross databases. 
+# Syntax
+{% highlight sql %}
+ALTER VIEW viewIdentifier RENAME TO viewIdentifier
+viewIdentifier:= [db_name.]view_name
+{% endhighlight %}
+
+
+ Set view properties
 
 Review comment:
   @huaxingao


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] kevinyu98 commented on a change in pull request #25573: [SPARK-28833][DOCS][SQL] Document ALTER VIEW command

2019-11-08 Thread GitBox
kevinyu98 commented on a change in pull request #25573: 
[SPARK-28833][DOCS][SQL] Document ALTER VIEW command
URL: https://github.com/apache/spark/pull/25573#discussion_r344431040
 
 

 ##
 File path: docs/sql-ref-syntax-ddl-alter-view.md
 ##
 @@ -19,4 +19,78 @@ license: |
   limitations under the License.
 ---
 
-**This page is under construction**
+### Description
+The `ALTER VIEW` statement changes various auxiliary properties of a view.
+
+
+ Rename view
+Rename the existing view. If the view name already exists in the database, an 
exception is thrown. This operation does 
 
 Review comment:
   @srowen, I changed this session to the following, let me know if you are 
thinking something else. 
   ` Rename VIEW
   
   Renames the existing view. If the view name already exists in the source 
database, an exception is thrown. This operation does not support moving the 
views cross databases. `


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] kevinyu98 commented on a change in pull request #25573: [SPARK-28833][DOCS][SQL] Document ALTER VIEW command

2019-11-08 Thread GitBox
kevinyu98 commented on a change in pull request #25573: 
[SPARK-28833][DOCS][SQL] Document ALTER VIEW command
URL: https://github.com/apache/spark/pull/25573#discussion_r344427485
 
 

 ##
 File path: docs/sql-ref-syntax-ddl-alter-view.md
 ##
 @@ -19,4 +19,78 @@ license: |
   limitations under the License.
 ---
 
-**This page is under construction**
+### Description
+The `ALTER VIEW` statement changes various auxiliary properties of a view.
+
+
+ Rename view
 
 Review comment:
   @huaxingao@srowen 
   


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] kevinyu98 commented on a change in pull request #25573: [SPARK-28833][DOCS][SQL] Document ALTER VIEW command

2019-08-24 Thread GitBox
kevinyu98 commented on a change in pull request #25573: 
[SPARK-28833][DOCS][SQL] Document ALTER VIEW command
URL: https://github.com/apache/spark/pull/25573#discussion_r317382281
 
 

 ##
 File path: docs/sql-ref-syntax-ddl-alter-view.md
 ##
 @@ -19,4 +19,69 @@ license: |
   limitations under the License.
 ---
 
-**This page is under construction**
+### Description
+The `ALTER VIEW` statement changes various auxiliary properties of a view.
+
+
+ Rename view
+Rename the existing view. If the view name already exists in the database, an 
exception is thrown. This operation does 
+support moving the views cross databases. 
+# Syntax
+{% highlight sql %}
+ALTER VIEW [db_name.]view_name RENAME TO [db_name.]new_view_name
+{% endhighlight %}
+
+
+ Set view properties
+Set one or more properties of an existing view. The properties are the key 
value pairs. If the properties' keys exist, 
+the values are replaced with the new values. If the properties' keys does not 
exist, the key value pairs are added into 
+the properties.
+# Syntax
+{% highlight sql %}
+ALTER VIEW view_name SET TBLPROPERTIES (key1=val1, key2=val2, ...)
+{% endhighlight %}
+
+
+ Drop view properties
+Drop one or more properties of an existing view. If the specified keys do not 
exist, an exception is thrown. Use 
+`IF EXISTS` to avoid the exception. 
+# Syntax
+{% highlight sql %}
+ALTER VIEW view_name UNSET TBLPROPERTIES [IF EXISTS] (key1=val1, key2=val2, 
...)
+{% endhighlight %}
+
+
+ Alter View As Select
+`ALTER VIEW AS SELECT` statement changes the definition of a view, the 
`select_statement` must valid, and the `VIEW` 
+must exist.
+# Syntax
+{% highlight sql %}
+ALTER VIEW view_name AS select_statement
+{% endhighlight %}
+
+
+ Example
+{% highlight sql %}
+-- Rename only change the view name.
+ALTER VIEW tempdb.view1 RENAME TO tempdb.view2
+{% endhighlight %}
+
+{% highlight sql %}
+-- Use `DESC TABLE EXTENDED tempdb.view1` before and after the `ALTER VIEW` 
statement to verify the changes.
+ALTER VIEW tempdb.view1 SET TBLPROPERTIES ('propKey1' = "propVal1", 'propKey2' 
= "propVal2" )
+{% endhighlight %}
+
+{% highlight sql %}
+-- Use `DESC TABLE EXTENDED tempdb.view1` before and after the `ALTER VIEW` to 
verify the change.
+ALTER VIEW tempdb.view1 UNSET TBLPROPERTIES ('propKey1'')
 
 Review comment:
   changed, thanks.


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] kevinyu98 commented on a change in pull request #25573: [SPARK-28833][DOCS][SQL] Document ALTER VIEW command

2019-08-24 Thread GitBox
kevinyu98 commented on a change in pull request #25573: 
[SPARK-28833][DOCS][SQL] Document ALTER VIEW command
URL: https://github.com/apache/spark/pull/25573#discussion_r317382263
 
 

 ##
 File path: docs/sql-ref-syntax-ddl-alter-view.md
 ##
 @@ -19,4 +19,69 @@ license: |
   limitations under the License.
 ---
 
-**This page is under construction**
+### Description
+The `ALTER VIEW` statement changes various auxiliary properties of a view.
+
+
+ Rename view
+Rename the existing view. If the view name already exists in the database, an 
exception is thrown. This operation does 
+support moving the views cross databases. 
+# Syntax
+{% highlight sql %}
+ALTER VIEW [db_name.]view_name RENAME TO [db_name.]new_view_name
+{% endhighlight %}
+
+
+ Set view properties
+Set one or more properties of an existing view. The properties are the key 
value pairs. If the properties' keys exist, 
+the values are replaced with the new values. If the properties' keys does not 
exist, the key value pairs are added into 
+the properties.
+# Syntax
+{% highlight sql %}
+ALTER VIEW view_name SET TBLPROPERTIES (key1=val1, key2=val2, ...)
+{% endhighlight %}
+
+
+ Drop view properties
+Drop one or more properties of an existing view. If the specified keys do not 
exist, an exception is thrown. Use 
+`IF EXISTS` to avoid the exception. 
+# Syntax
+{% highlight sql %}
+ALTER VIEW view_name UNSET TBLPROPERTIES [IF EXISTS] (key1=val1, key2=val2, 
...)
+{% endhighlight %}
+
+
+ Alter View As Select
+`ALTER VIEW AS SELECT` statement changes the definition of a view, the 
`select_statement` must valid, and the `VIEW` 
+must exist.
+# Syntax
+{% highlight sql %}
+ALTER VIEW view_name AS select_statement
+{% endhighlight %}
+
+
+ Example
+{% highlight sql %}
+-- Rename only change the view name.
+ALTER VIEW tempdb.view1 RENAME TO tempdb.view2
 
 Review comment:
   yah, we can use qualified or unqualified name for the target view, I will 
add a note there. thanks.


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] kevinyu98 commented on a change in pull request #25573: [SPARK-28833][DOCS][SQL] Document ALTER VIEW command

2019-08-24 Thread GitBox
kevinyu98 commented on a change in pull request #25573: 
[SPARK-28833][DOCS][SQL] Document ALTER VIEW command
URL: https://github.com/apache/spark/pull/25573#discussion_r317373479
 
 

 ##
 File path: docs/sql-ref-syntax-ddl-alter-view.md
 ##
 @@ -19,4 +19,69 @@ license: |
   limitations under the License.
 ---
 
-**This page is under construction**
+### Description
+The `ALTER VIEW` statement changes various auxiliary properties of a view.
+
+
+ Rename view
+Rename the existing view. If the view name already exists in the database, an 
exception is thrown. This operation does 
+support moving the views cross databases. 
+# Syntax
+{% highlight sql %}
+ALTER VIEW [db_name.]view_name RENAME TO [db_name.]new_view_name
+{% endhighlight %}
+
+
+ Set view properties
+Set one or more properties of an existing view. The properties are the key 
value pairs. If the properties' keys exist, 
+the values are replaced with the new values. If the properties' keys does not 
exist, the key value pairs are added into 
+the properties.
+# Syntax
+{% highlight sql %}
+ALTER VIEW view_name SET TBLPROPERTIES (key1=val1, key2=val2, ...)
+{% endhighlight %}
+
+
+ Drop view properties
+Drop one or more properties of an existing view. If the specified keys do not 
exist, an exception is thrown. Use 
+`IF EXISTS` to avoid the exception. 
+# Syntax
+{% highlight sql %}
+ALTER VIEW view_name UNSET TBLPROPERTIES [IF EXISTS] (key1=val1, key2=val2, 
...)
+{% endhighlight %}
+
+
+ Alter View As Select
+`ALTER VIEW AS SELECT` statement changes the definition of a view, the 
`select_statement` must valid, and the `VIEW` 
+must exist.
+# Syntax
+{% highlight sql %}
+ALTER VIEW view_name AS select_statement
 
 Review comment:
   ok, I will link to the select statement page


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] kevinyu98 commented on a change in pull request #25573: [SPARK-28833][DOCS][SQL] Document ALTER VIEW command

2019-08-24 Thread GitBox
kevinyu98 commented on a change in pull request #25573: 
[SPARK-28833][DOCS][SQL] Document ALTER VIEW command
URL: https://github.com/apache/spark/pull/25573#discussion_r317373467
 
 

 ##
 File path: docs/sql-ref-syntax-ddl-alter-view.md
 ##
 @@ -19,4 +19,69 @@ license: |
   limitations under the License.
 ---
 
-**This page is under construction**
+### Description
+The `ALTER VIEW` statement changes various auxiliary properties of a view.
+
+
+ Rename view
+Rename the existing view. If the view name already exists in the database, an 
exception is thrown. This operation does 
+support moving the views cross databases. 
+# Syntax
+{% highlight sql %}
+ALTER VIEW [db_name.]view_name RENAME TO [db_name.]new_view_name
+{% endhighlight %}
+
+
+ Set view properties
+Set one or more properties of an existing view. The properties are the key 
value pairs. If the properties' keys exist, 
+the values are replaced with the new values. If the properties' keys does not 
exist, the key value pairs are added into 
+the properties.
+# Syntax
+{% highlight sql %}
+ALTER VIEW view_name SET TBLPROPERTIES (key1=val1, key2=val2, ...)
 
 Review comment:
   sure, will change


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] kevinyu98 commented on a change in pull request #25573: [SPARK-28833][DOCS][SQL] Document ALTER VIEW command

2019-08-24 Thread GitBox
kevinyu98 commented on a change in pull request #25573: 
[SPARK-28833][DOCS][SQL] Document ALTER VIEW command
URL: https://github.com/apache/spark/pull/25573#discussion_r317373468
 
 

 ##
 File path: docs/sql-ref-syntax-ddl-alter-view.md
 ##
 @@ -19,4 +19,69 @@ license: |
   limitations under the License.
 ---
 
-**This page is under construction**
+### Description
+The `ALTER VIEW` statement changes various auxiliary properties of a view.
+
+
+ Rename view
+Rename the existing view. If the view name already exists in the database, an 
exception is thrown. This operation does 
+support moving the views cross databases. 
+# Syntax
+{% highlight sql %}
+ALTER VIEW [db_name.]view_name RENAME TO [db_name.]new_view_name
+{% endhighlight %}
+
+
+ Set view properties
+Set one or more properties of an existing view. The properties are the key 
value pairs. If the properties' keys exist, 
+the values are replaced with the new values. If the properties' keys does not 
exist, the key value pairs are added into 
+the properties.
+# Syntax
+{% highlight sql %}
+ALTER VIEW view_name SET TBLPROPERTIES (key1=val1, key2=val2, ...)
+{% endhighlight %}
+
+
+ Drop view properties
+Drop one or more properties of an existing view. If the specified keys do not 
exist, an exception is thrown. Use 
+`IF EXISTS` to avoid the exception. 
+# Syntax
+{% highlight sql %}
+ALTER VIEW view_name UNSET TBLPROPERTIES [IF EXISTS] (key1=val1, key2=val2, 
...)
 
 Review comment:
   ok


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