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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]