dejankrak-db commented on code in PR #49084:
URL: https://github.com/apache/spark/pull/49084#discussion_r1897391274
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/command/ddl.scala:
##########
@@ -304,12 +304,13 @@ case class AlterTableSetPropertiesCommand(
override def run(sparkSession: SparkSession): Seq[Row] = {
val catalog = sparkSession.sessionState.catalog
val table = catalog.getTableRawMetadata(tableName)
- // This overrides old properties and update the comment parameter of
CatalogTable
- // with the newly added/modified comment since CatalogTable also holds
comment as its
- // direct property.
+ // This overrides old properties and updates the comment and collation
parameters of
+ // CatalogTable with the newly added/modified comment and collation since
CatalogTable
+ // also holds comment and collation as its direct properties.
val newTable = table.copy(
properties = table.properties ++ properties,
- comment =
properties.get(TableCatalog.PROP_COMMENT).orElse(table.comment))
+ comment =
properties.get(TableCatalog.PROP_COMMENT).orElse(table.comment),
+ collation =
properties.get(TableCatalog.PROP_COLLATION).orElse(table.collation))
Review Comment:
Actually, @cloud-fan, you are right, because we raise an error in
AstBuilder.cleanTableProperties() when someone attempts to change collation
through SET/UNSET TBLPROPERTIES, so no changes to the collation should be
possible here or below in AlterTableUnsetPropertiesCommand - hence, I've
reverted the changes in this file. Good catch!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]