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/06 12:23:39 UTC
[GitHub] [spark] MaxGekk commented on a change in pull request #31066: [SPARK-34027][SQL] Refresh cache in `ALTER TABLE .. RECOVER PARTITIONS`
MaxGekk commented on a change in pull request #31066:
URL: https://github.com/apache/spark/pull/31066#discussion_r552555033
##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/command/ddl.scala
##########
@@ -675,7 +675,7 @@ case class AlterTableRecoverPartitionsCommand(
// This is always the case for Hive format tables, but is not true for Datasource tables created
// before Spark 2.1 unless they are converted via `msck repair table`.
spark.sessionState.catalog.alterTable(table.copy(tracksPartitionsInCatalog = true))
- catalog.refreshTable(tableName)
+ spark.catalog.refreshTable(tableIdentWithDB)
Review comment:
Here, we invoke https://github.com/apache/spark/blob/3fdbc48373cdf12b8ba05632bc65ad49b7af1afb/sql/core/src/main/scala/org/apache/spark/sql/internal/CatalogImpl.scala#L514 instead of https://github.com/apache/spark/blob/cc1d9d25fb4c2e4af912d6f9802de8f351c32deb/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala#L990 . The last one doesn't refresh the cache.
----------------------------------------------------------------
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