This is an automated email from the ASF dual-hosted git repository.
dongjoon pushed a commit to branch branch-3.2
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/branch-3.2 by this push:
new d046b98ea61 [SPARK-40574][DOCS] Enhance DROP TABLE documentation
d046b98ea61 is described below
commit d046b98ea6115129ee84828d61f383b8d1e3dca9
Author: Yuming Wang <[email protected]>
AuthorDate: Tue Sep 27 15:32:37 2022 -0700
[SPARK-40574][DOCS] Enhance DROP TABLE documentation
### What changes were proposed in this pull request?
This PR adds `PURGE` in `DROP TABLE` documentation.
Related documentation and code:
1. Hive `DROP TABLE` documentation:
https://cwiki.apache.org/confluence/display/hive/languagemanual+ddl
<img width="877" alt="image"
src="https://user-images.githubusercontent.com/5399861/192425153-63ac5373-dd34-48b3-864c-324cf5ba5db9.png">
2. Hive code:
https://github.com/apache/hive/blob/rel/release-2.3.9/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java#L1185-L1209
3. Spark code:
https://github.com/apache/spark/blob/v3.3.0/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveShim.scala#L1317-L1327
### Why are the changes needed?
Enhance documentation.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
manual test.
Closes #38011 from wangyum/SPARK-40574.
Authored-by: Yuming Wang <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
(cherry picked from commit 11eefc81e5c1f3ec7db6df8ba068a7155f7abda3)
Signed-off-by: Dongjoon Hyun <[email protected]>
---
docs/sql-ref-syntax-ddl-drop-table.md | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/docs/sql-ref-syntax-ddl-drop-table.md
b/docs/sql-ref-syntax-ddl-drop-table.md
index 6c115fd5f83..ce1b033a4ea 100644
--- a/docs/sql-ref-syntax-ddl-drop-table.md
+++ b/docs/sql-ref-syntax-ddl-drop-table.md
@@ -31,7 +31,7 @@ If the table is cached, the command uncaches the table and
all its dependents.
### Syntax
```sql
-DROP TABLE [ IF EXISTS ] table_identifier
+DROP TABLE [ IF EXISTS ] table_identifier [ PURGE ]
```
### Parameter
@@ -46,6 +46,10 @@ DROP TABLE [ IF EXISTS ] table_identifier
**Syntax:** `[ database_name. ] table_name`
+* **PURGE**
+
+ If specified, completely purge the table skipping trash while dropping
table(Note: PURGE available in Hive Metastore 0.14.0 and later).
+
### Examples
```sql
@@ -64,6 +68,9 @@ Error: org.apache.spark.sql.AnalysisException: Table or view
not found: employee
-- Assumes a table named `employeetable` does not exist,Try with IF EXISTS
-- this time it will not throw exception
DROP TABLE IF EXISTS employeetable;
+
+-- Completely purge the table skipping trash.
+DROP TABLE employeetable PURGE;
```
### Related Statements
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]