srowen commented on a change in pull request #25533:
[SPARK-28798][DOC][SQL]Document DROP TABLE/VIEW statement in SQL Reference.
URL: https://github.com/apache/spark/pull/25533#discussion_r337179648
##########
File path: docs/sql-ref-syntax-ddl-drop-view.md
##########
@@ -19,4 +19,63 @@ license: |
limitations under the License.
---
-**This page is under construction**
+### Description
+DROP VIEW removes the metadata associated with a specified view from the
catalog.
+
+### Syntax
+{% highlight sql %}
+DROP VIEW [IF EXISTS] [database_name.]view_name
+{% endhighlight %}
+
+### Parameter
+<dl>
+ <dt><code><em>IF EXISTS</em></code></dt>
+ <dd>
+ If specified, no exception is thrown when the view does not exist.
+ </dd>
+ <dt><code><em>database_name</em></code></dt>
+ <dd>
+ Specifies the database name where view is present.
+ </dd>
+ <dt><code><em>view_name</em></code></dt>
+ <dd>
+ Specifies the view name to be dropped.
+ </dd>
+</dl>
+
+### Example
+{% highlight sql %}
+-- Assumes a view name `employeeView` exist.
+DROP VIEW employeeView;
++---------+--+
+| Result |
++---------+--+
++---------+--+
+
+-- Assumes a view name `employeeView` exist in `userdb` database
+DROP VIEW userdb.employeeView;
++---------+--+
+| Result |
++---------+--+
++---------+--+
+
+-- Assumes a view name `employeeView` does not exist.
+-- Throws exception
+DROP VIEW employeeView;
+Error: org.apache.spark.sql.AnalysisException: Table or view not found:
employeeView;
+(state=,code=0)
+
+-- Assumes a view name `employeeView` does not exist,Try with IF EXISTS
+-- this time it will not throw exception
+DROP VIEW IF EXISTS employeeView;
++---------+--+
+| Result |
++---------+--+
++---------+--+
+
+{% endhighlight %}
+
+### Related Statements
+- [CREATE VIEW ](sql-ref-syntax-ddl-create-view.html)
Review comment:
Tiny nit: extra space inside bracket
----------------------------------------------------------------
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]