MaxGekk commented on a change in pull request #31114:
URL: https://github.com/apache/spark/pull/31114#discussion_r554605596



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/command/ddl.scala
##########
@@ -486,18 +486,8 @@ case class AlterTableAddPartitionCommand(
     }
 
     sparkSession.catalog.refreshTable(table.identifier.quotedString)
-    if (table.stats.nonEmpty) {
-      if (sparkSession.sessionState.conf.autoSizeUpdateEnabled) {
-        val addedSize = 
CommandUtils.calculateMultipleLocationSizes(sparkSession, table.identifier,

Review comment:
       You are right. I think we could do similar optimization in 
`updateTableStats` by comparing new size with existing one in `CatalogTable`. 
So, the optimization can be picked up by other commands.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to