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



##########
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:
       I think this avoids the external catalog call if `addedSize` is 0, which 
`updateTableStats` doesn't do, but I guess in most cases `addedSize` should be 
> 0.




----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to