Skip to content

Commit 923e594

Browse files
dongjoon-hyungatorsmile
authored andcommitted
[SPARK-18941][SQL][DOC] Add a new behavior document on CREATE/DROP TABLE with LOCATION
## What changes were proposed in this pull request? This PR adds a new behavior change description on `CREATE TABLE ... LOCATION` at `sql-programming-guide.md` clearly under `Upgrading From Spark SQL 1.6 to 2.0`. This change is introduced at Apache Spark 2.0.0 as [SPARK-15276](https://issues.apache.org/jira/browse/SPARK-15276). ## How was this patch tested? ``` SKIP_API=1 jekyll build ``` **Newly Added Description** <img width="913" alt="new" src="https://cloud.githubusercontent.com/assets/9700541/21743606/7efe2b12-d4ba-11e6-8a0d-551222718ea2.png"> Author: Dongjoon Hyun <[email protected]> Closes #16400 from dongjoon-hyun/SPARK-18941.
1 parent 54138f6 commit 923e594

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

docs/sql-programming-guide.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1413,6 +1413,14 @@ options.
14131413
- Dataset and DataFrame API `explode` has been deprecated, alternatively, use `functions.explode()` with `select` or `flatMap`
14141414
- Dataset and DataFrame API `registerTempTable` has been deprecated and replaced by `createOrReplaceTempView`
14151415

1416+
- Changes to `CREATE TABLE ... LOCATION` behavior for Hive tables.
1417+
- From Spark 2.0, `CREATE TABLE ... LOCATION` is equivalent to `CREATE EXTERNAL TABLE ... LOCATION`
1418+
in order to prevent accidental dropping the existing data in the user-provided locations.
1419+
That means, a Hive table created in Spark SQL with the user-specified location is always a Hive external table.
1420+
Dropping external tables will not remove the data. Users are not allowed to specify the location for Hive managed tables.
1421+
Note that this is different from the Hive behavior.
1422+
- As a result, `DROP TABLE` statements on those tables will not remove the data.
1423+
14161424
## Upgrading From Spark SQL 1.5 to 1.6
14171425

14181426
- From Spark 1.6, by default the Thrift server runs in multi-session mode. Which means each JDBC/ODBC

0 commit comments

Comments
 (0)