You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (Jira)" <ji...@apache.org> on 2021/01/10 16:19:00 UTC
[jira] [Assigned] (SPARK-34062) Call updateTableStats() from
AlterTableAddPartitionCommand
[ https://issues.apache.org/jira/browse/SPARK-34062?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Apache Spark reassigned SPARK-34062:
------------------------------------
Assignee: Apache Spark
> Call updateTableStats() from AlterTableAddPartitionCommand
> ----------------------------------------------------------
>
> Key: SPARK-34062
> URL: https://issues.apache.org/jira/browse/SPARK-34062
> Project: Spark
> Issue Type: Improvement
> Components: SQL
> Affects Versions: 3.2.0
> Reporter: Maxim Gekk
> Assignee: Apache Spark
> Priority: Major
>
> AlterTableAddPartitionCommand.run does almost the same as `CommandUtils.updateTableStats` while updating table stats. The code:
> {code:scala}
> if (table.stats.nonEmpty) {
> if (sparkSession.sessionState.conf.autoSizeUpdateEnabled) {
> val addedSize = CommandUtils.calculateMultipleLocationSizes(sparkSession, table.identifier,
> parts.map(_.storage.locationUri)).sum
> if (addedSize > 0) {
> val newStats = CatalogStatistics(sizeInBytes = table.stats.get.sizeInBytes + addedSize)
> catalog.alterTableStats(table.identifier, Some(newStats))
> }
> } else {
> catalog.alterTableStats(table.identifier, None)
> }
> }
> {code}
> can be replaced by:
> {code:scala}
> CommandUtils.updateTableStats()
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org