Github user dongjoon-hyun commented on a diff in the pull request: https://github.com/apache/spark/pull/19086#discussion_r136609981 --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala --- @@ -576,25 +576,25 @@ class SessionCatalog( * This assumes the database specified in `newName` matches the one in `oldName`. */ def renameTable(oldName: TableIdentifier, newName: TableIdentifier): Unit = synchronized { - val db = formatDatabaseName(oldName.database.getOrElse(currentDb)) - newName.database.map(formatDatabaseName).foreach { newDb => - if (db != newDb) { - throw new AnalysisException( - s"RENAME TABLE source and destination databases do not match: '$db' != '$newDb'") - } - } + val oldDb = formatDatabaseName(oldName.database.getOrElse(currentDb)) + val newDb = formatDatabaseName(newName.database.getOrElse(oldDb)) --- End diff -- Hi, @jinxing64 . Is this correct? I guess that this should be `currentDb` instead of `oldDb`.
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org