xiarixiaoyao commented on a change in pull request #4587: URL: https://github.com/apache/hudi/pull/4587#discussion_r783928372
########## File path: hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/spark/sql/hudi/command/AlterHoodieTableChangeColumnCommand.scala ########## @@ -42,24 +42,27 @@ case class AlterHoodieTableChangeColumnCommand( extends HoodieLeafRunnableCommand { override def run(sparkSession: SparkSession): Seq[Row] = { + val resolver = sparkSession.sessionState.conf.resolver val hoodieCatalogTable = HoodieCatalogTable(sparkSession, tableIdentifier) - val resolver = sparkSession.sessionState.conf.resolver - if (!resolver(columnName, newColumn.name)) { - throw new AnalysisException(s"Can not support change column name for hudi table currently.") - } + // Find the origin column from dataSchema by column name. + val originColumn = findColumnByName(hoodieCatalogTable.dataSchema, columnName, resolver).getOrElse( + throw new AnalysisException(s"Can't find column `$columnName` given table data columns " + + s"${hoodieCatalogTable.dataSchema.fieldNames.mkString("[`", "`, `", "`]")}") + ) + Review comment: I don't think we support rename operation now, Why remove relevant judgments? -- 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: commits-unsubscr...@hudi.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org