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 2019/02/28 07:08:37 UTC

[GitHub] Udbhav30 commented on a change in pull request #23905: [SPARK-24669][SQL] Refresh table before drop database cascade

Udbhav30 commented on a change in pull request #23905: [SPARK-24669][SQL] Refresh table before drop database cascade
URL: https://github.com/apache/spark/pull/23905#discussion_r261068068
 
 

 ##########
 File path: sql/core/src/main/scala/org/apache/spark/sql/execution/command/ddl.scala
 ##########
 @@ -102,6 +102,12 @@ case class DropDatabaseCommand(
   extends RunnableCommand {
 
   override def run(sparkSession: SparkSession): Seq[Row] = {
+    if (databaseName != "default" && cascade) {
+      val catalog = sparkSession.sessionState.catalog
+      catalog.listTables(databaseName).foreach { t =>
+        catalog.refreshTable(t)
+      }
+    }
     sparkSession.sessionState.catalog.dropDatabase(databaseName, ifExists, cascade)
 
 Review comment:
   yes i have moved that code to catalog.dropDatabase functions, i also think that make more sense

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services

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