You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by do...@apache.org on 2022/09/27 22:33:01 UTC
[spark] branch branch-3.3 updated: [SPARK-40574][DOCS] Enhance DROP TABLE documentation
This is an automated email from the ASF dual-hosted git repository.
dongjoon pushed a commit to branch branch-3.3
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/branch-3.3 by this push:
new 367d3e530e2 [SPARK-40574][DOCS] Enhance DROP TABLE documentation
367d3e530e2 is described below
commit 367d3e530e299b8cc0d2061ec3f6407b84e1787c
Author: Yuming Wang <yu...@ebay.com>
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 <yu...@ebay.com>
Signed-off-by: Dongjoon Hyun <do...@apache.org>
(cherry picked from commit 11eefc81e5c1f3ec7db6df8ba068a7155f7abda3)
Signed-off-by: Dongjoon Hyun <do...@apache.org>
---
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: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org