jinxing64 commented on code in PR #5320:
URL: https://github.com/apache/hudi/pull/5320#discussion_r854067054
##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/spark/sql/hudi/command/AlterHoodieTableRenameCommand.scala:
##########
@@ -46,6 +45,15 @@ class AlterHoodieTableRenameCommand(
// Call AlterTableRenameCommand#run to rename table in meta.
super.run(sparkSession)
+
+ // update table properties path in every op
+ if (hoodieCatalogTable.catalogProperties.contains("path")) {
+ val catalogTable =
sparkSession.sessionState.catalog.getTableMetadata(newName)
+ val path = catalogTable.storage.locationUri.get.getPath
+ logInfo(s"alter ${oldName} name to ${newName}, update tblp 'path' to
${path}")
Review Comment:
How about `Alter table name from {oldName} to {newName}, update table
property of 'path' to {path}`
##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/spark/sql/hudi/command/AlterHoodieTableRenameCommand.scala:
##########
@@ -46,6 +45,15 @@ class AlterHoodieTableRenameCommand(
// Call AlterTableRenameCommand#run to rename table in meta.
super.run(sparkSession)
+
+ // update table properties path in every op
Review Comment:
Shall we check and apply below logic only when it's a 'MANAGED' table --
thus to save some remote calls to HMS ?
--
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]