We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e95c603 commit 71d9ad1Copy full SHA for 71d9ad1
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/V2SessionCatalog.scala
@@ -154,10 +154,8 @@ class V2SessionCatalog(sessionState: SessionState) extends TableCatalog {
154
}
155
156
override def renameTable(oldIdent: Identifier, newIdent: Identifier): Unit = {
157
- try {
158
- if (Option(loadTable(newIdent)).isDefined) throw new TableAlreadyExistsException(newIdent)
159
- } catch {
160
- case _: NoSuchTableException =>
+ if (tableExists(newIdent)) {
+ throw new TableAlreadyExistsException(newIdent)
161
162
163
// Load table to make sure the table exists
0 commit comments