-
- Downloads
[SPARK-15276][SQL] CREATE TABLE with LOCATION should imply EXTERNAL
## What changes were proposed in this pull request? Before: ```sql -- uses that location but issues a warning CREATE TABLE my_tab LOCATION /some/path -- deletes any existing data in the specified location DROP TABLE my_tab ``` After: ```sql -- uses that location but creates an EXTERNAL table instead CREATE TABLE my_tab LOCATION /some/path -- does not delete the data at /some/path DROP TABLE my_tab ``` This patch essentially makes the `EXTERNAL` field optional. This is related to #13032. ## How was this patch tested? New test in `DDLCommandSuite`. Author: Andrew Or <andrew@databricks.com> Closes #13060 from andrewor14/location-implies-external.
Showing
- sql/core/src/main/scala/org/apache/spark/sql/execution/SparkSqlParser.scala 7 additions, 5 deletions...scala/org/apache/spark/sql/execution/SparkSqlParser.scala
- sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLCommandSuite.scala 12 additions, 0 deletions.../apache/spark/sql/execution/command/DDLCommandSuite.scala
- sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala 3 additions, 5 deletions...la/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala
- sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala 1 addition, 4 deletions...a/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala
Loading
Please register or sign in to comment