You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by gatorsmile <gi...@git.apache.org> on 2016/10/12 05:51:29 UTC
[GitHub] spark pull request #15230: [SPARK-17657] [SQL] Disallow Users to Change Tabl...
Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/15230#discussion_r82940270
--- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/command/ddl.scala ---
@@ -225,6 +225,11 @@ case class AlterTableSetPropertiesCommand(
val catalog = sparkSession.sessionState.catalog
val table = catalog.getTableMetadata(tableName)
DDLUtils.verifyAlterTableType(catalog, table, isView)
+ // Not allowed to switch the table type.
+ if (properties.contains("EXTERNAL")) {
--- End diff --
This is officially documented in the Hive document, as shown in the [link](https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL):
`TBLPROPERTIES ("EXTERNAL"="TRUE") in release 0.6.0+ (HIVE-1329) \u2013 Change a managed table to an external table and vice versa for "FALSE".`
This is the only property users are not allowed to change. The other Hive-specific properties are still allowed to change, because Hive also allows it.
For the our Spark-reserved properties, users are not allowed to change. See the function call `verifyTableProperties` in `[alterTable](https://github.com/apache/spark/blob/b9a147181d5e38d9abed0c7215f4c5cb695f579c/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveExternalCatalog.scala#L393)`.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org