You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/01/10 15:53:06 UTC

[GitHub] [spark] MaxGekk commented on a change in pull request #22721: [SPARK-19784][SPARK-25403][SQL] Refresh the table even table stats is empty

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:
users@infra.apache.org



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