MaxGekk commented on a change in pull request #22721:
URL: https://github.com/apache/spark/pull/22721#discussion_r554586011
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/command/CommandUtils.scala
##########
@@ -50,6 +50,9 @@ object CommandUtils extends Logging {
catalog.alterTableStats(table.identifier, Some(newStats))
} else if (table.stats.nonEmpty) {
catalog.alterTableStats(table.identifier, None)
+ } else {
+ // In other cases, we still need to invalidate the table relation cache.
Review comment:
Could you explain why we need to refresh table while updating stats,
please. For instance, we can do the same work twice. See:
1. InsertIntoHiveTable:
https://github.com/apache/spark/blob/157b72ac9fa0057d5fd6d7ed52a6c4b22ebd1dfc/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/InsertIntoHiveTable.scala#L113-L115
2. LoadDataCommand :
https://github.com/apache/spark/blob/ddc0d5148ac6decde160cca847b5db5d6de1be58/sql/core/src/main/scala/org/apache/spark/sql/execution/command/tables.scala#L394-L396
3. AlterTableDropPartitionCommand:
https://github.com/apache/spark/blob/e0e06c18fd479ac86963ec26ab82b0dc5536bc83/sql/core/src/main/scala/org/apache/spark/sql/execution/command/ddl.scala#L586-L587
----------------------------------------------------------------
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]