Github user liancheng commented on a diff in the pull request:
https://github.com/apache/spark/pull/14897#discussion_r80280321
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala
---
@@ -424,17 +496,24 @@ class SessionCatalog(
purge: Boolean): Unit = synchronized {
val db = formatDatabaseName(name.database.getOrElse(currentDb))
val table = formatTableName(name.table)
- if (name.database.isDefined || !tempTables.contains(table)) {
- requireDbExists(db)
- // When ignoreIfNotExists is false, no exception is issued when the
table does not exist.
- // Instead, log it as an error message.
- if (tableExists(TableIdentifier(table, Option(db)))) {
- externalCatalog.dropTable(db, table, ignoreIfNotExists = true,
purge = purge)
- } else if (!ignoreIfNotExists) {
- throw new NoSuchTableException(db = db, table = table)
+ if (db == globalTempDB) {
+ val viewExists = globalTempViews.remove(table)
+ if (!viewExists && !ignoreIfNotExists) {
+ throw new NoSuchTableException(globalTempDB, table)
}
} else {
- tempTables.remove(table)
+ if (name.database.isDefined || !tempTables.contains(table)) {
+ requireDbExists(db)
+ // When ignoreIfNotExists is false, no lexception is issued when
the table does not exist.
--- End diff --
Nit: "exception" misspelt.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]