xkrogen commented on code in PR #39826:
URL: https://github.com/apache/spark/pull/39826#discussion_r1092482699
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/V2SessionCatalog.scala:
##########
@@ -149,26 +150,42 @@ class V2SessionCatalog(catalog: SessionCatalog)
throw QueryCompilationErrors.noSuchTableError(ident)
}
- val properties =
CatalogV2Util.applyPropertiesChanges(catalogTable.properties, changes)
- val schema = CatalogV2Util.applySchemaChanges(
- catalogTable.schema, changes, catalogTable.provider, "ALTER TABLE")
- val comment = properties.get(TableCatalog.PROP_COMMENT)
- val owner = properties.getOrElse(TableCatalog.PROP_OWNER,
catalogTable.owner)
- val location =
properties.get(TableCatalog.PROP_LOCATION).map(CatalogUtils.stringToURI)
- val storage = if (location.isDefined) {
- catalogTable.storage.copy(locationUri = location)
- } else {
- catalogTable.storage
+
+ val (columnChanges, otherChanges) = changes.toSeq.partition(change =>
+ change.isInstanceOf[ColumnChange] &&
+ // Not supported changes in alterTableDataSchema
+ !change.isInstanceOf[RenameColumn] &&
!change.isInstanceOf[DeleteColumn]
Review Comment:
Or another somewhat related question, is the right approach to instead make
`HiveExternalCatalog.alterTable()` support modifying the schema? It seems like
this would be more in line with other implementations of `alterTable`. I see
this comment was added as part of PR #14155:
```
* Note: As of now, this doesn't support altering table schema, partition
column names and bucket
* specification. We will ignore them even if users do specify different
values for these fields.
```
It's not clear to me if this was intentional, or something that was intended
to be built on top of / fixed. @cloud-fan , thoughts here?
--
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]