wombatu-kun commented on code in PR #20426:
URL: https://github.com/apache/hudi/pull/20426#discussion_r4374433190
##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/spark/sql/hudi/HoodieOptionConfig.scala:
##########
@@ -182,6 +182,21 @@ object HoodieOptionConfig {
}
}
+ /**
+ * Map a SQL option, data source write config or table config, given by key
and value, to the table config
+ * it is persisted as in hoodie.properties. Returns None if it is not
persisted as a table config.
+ */
+ def mapToTableConfig(key: String, value: String): Option[(String, String)] =
{
+ val sqlKey = writeConfigKeyToSqlOptionKey.getOrElse(key,
tableConfigKeyToSqlOptionKey.getOrElse(key, key))
+ if (sqlOptionKeyToTableConfigKey.contains(sqlKey)) {
+ mapSqlOptionsToTableConfigs(Map(sqlKey -> value)).headOption
+ } else if (key.startsWith("hoodie.table.")) {
Review Comment:
`hoodie.table.services.enabled`, `hoodie.table.services.incremental.enabled`
and the `hoodie.table.service.manager.*` keys are write configs that never
reach hoodie.properties, but this branch treats them as persisted, so adding or
changing one through `alterTable` fails with "persisted in hoodie.properties
... (current value: unset)". Could this match the keys `HoodieTableConfig`
declares instead of the `hoodie.table.` prefix?
##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/spark/sql/hudi/catalog/HoodieCatalog.scala:
##########
@@ -255,13 +261,61 @@ class HoodieCatalog extends DelegatingCatalogExtension
case (t, _) =>
throw new UnsupportedOperationException(s"not supported table
change: ${t.getName}")
}
+ if (catalogPropertyChanges.nonEmpty) {
+ super.alterTable(ident, catalogPropertyChanges: _*)
Review Comment:
`V2SessionCatalog.alterTable` takes the new table comment from the property
map, and on a Hive metastore that map never holds `comment`, so once the
unchanged `comment` is dropped above, forwarding any other change here clears
the table comment. Could the unchanged `comment` be forwarded together with the
other changes?
--
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]