Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/sql-migration-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ license: |

- Since Spark 3.3, DESCRIBE FUNCTION fails if the function does not exist. In Spark 3.2 or earlier, DESCRIBE FUNCTION can still run and print "Function: func_name not found".

- Since Spark 3.3, the table property `external` becomes reserved. Certain commands will fail if you specify the `external` property, such as `CREATE TABLE ... TBLPROPERTIES` and `ALTER TABLE ... SET TBLPROPERTIES`. In Spark 3.2 and earlier, the table property `external` is silently ignored. You can set `spark.sql.legacy.notReserveProperties` to `true` to restore the old behavior.

## Upgrading from Spark SQL 3.1 to 3.2

- Since Spark 3.2, ADD FILE/JAR/ARCHIVE commands require each path to be enclosed by `"` or `'` if the path contains whitespaces.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3203,6 +3203,10 @@ class AstBuilder extends SqlBaseBaseVisitor[AnyRef] with SQLConfHelper with Logg
throw QueryParsingErrors.cannotCleanReservedTablePropertyError(
PROP_OWNER, ctx, "it will be set to the current user")
case (PROP_OWNER, _) => false
case (PROP_EXTERNAL, _) if !legacyOn =>
throw QueryParsingErrors.cannotCleanReservedTablePropertyError(
PROP_EXTERNAL, ctx, "please use CREATE EXTERNAL TABLE")
case (PROP_EXTERNAL, _) => false
case _ => true
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ private[sql] object CatalogV2Util {
Seq(TableCatalog.PROP_COMMENT,
TableCatalog.PROP_LOCATION,
TableCatalog.PROP_PROVIDER,
TableCatalog.PROP_OWNER)
TableCatalog.PROP_OWNER,
TableCatalog.PROP_EXTERNAL)

/**
* The list of reserved namespace properties, which can not be removed or changed directly by
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,7 @@ case class ShowCreateTableExec(
val showProps = table.properties.asScala
.filterKeys(key => !CatalogV2Util.TABLE_RESERVED_PROPERTIES.contains(key)
&& !key.startsWith(TableCatalog.OPTION_PREFIX)
&& !tableOptions.contains(key)
&& !key.equals(TableCatalog.PROP_EXTERNAL)
)
&& !tableOptions.contains(key))
if (showProps.nonEmpty) {
val props = showProps.toSeq.sortBy(_._1).map {
case (key, value) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -785,8 +785,7 @@ class V2SessionCatalogTableSuite extends V2SessionCatalogBaseSuite {
private def filterV2TableProperties(
properties: util.Map[String, String]): Map[String, String] = {
properties.asScala.filter(kv => !CatalogV2Util.TABLE_RESERVED_PROPERTIES.contains(kv._1))
.filter(!_._1.startsWith(TableCatalog.OPTION_PREFIX))
.filter(_._1 != TableCatalog.PROP_EXTERNAL).toMap
.filter(!_._1.startsWith(TableCatalog.OPTION_PREFIX)).toMap
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ class HiveDDLSuite
assert(
catalog.getTableMetadata(TableIdentifier(tabName)).tableType == CatalogTableType.MANAGED)
// The table property is case sensitive. Thus, external is allowed
sql(s"ALTER TABLE $tabName SET TBLPROPERTIES ('external' = 'TRUE')")
sql(s"ALTER TABLE $tabName SET TBLPROPERTIES ('External' = 'TRUE')")
// The table type is not changed to external
assert(
catalog.getTableMetadata(TableIdentifier(tabName)).tableType == CatalogTableType.MANAGED)
Expand Down