srowen 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_r344774890
##########
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
+<dl>
+ <dt><code><em>view_identifier</em></code></dt>
+ <dd>
+ Specifies a view name, which may be optionally qualified with a database
name.<br><br>
+ <b> Syntax:</b>
+ <code>
+ [database_name.]view_name
+ </code>
+ </dd>
+</dl>
+
+#### 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
+<dl>
+ <dt><code><em>view_identifier</em></code></dt>
+ <dd>
+ Specifies a view name, which may be optionally qualified with a database
name.<br><br>
+ <b> Syntax:</b>
+ <code>
+ [database_name.]view_name
+ </code>
+ </dd>
+ <dt><code><em>property_key</em></code></dt>
+ <dd>
+ Specifies the property key. The key may consists of multiple parts
separated by dot.<br><br>
+ <b>Syntax:</b>
+ <code>
+ [key_part1][.key_part2][...]
+ </code>
+ </dd>
+</dl>
+
+#### Drop VIEW properties
Review comment:
"Drop" doesn't seem like the right word if the keyword is UNSET?
"Unset View Properties" or "UNSET View Properties"? I'd all-caps only the
words that are SQL keywords.
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]