You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by ya...@apache.org on 2022/03/23 09:32:33 UTC
[spark] branch branch-3.1 updated: resolve conflicts
This is an automated email from the ASF dual-hosted git repository.
yao pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/branch-3.1 by this push:
new 43c6b91 resolve conflicts
43c6b91 is described below
commit 43c6b911bdf323ffe77f54aa5f50f4f2d2497676
Author: Kent Yao <ya...@apache.org>
AuthorDate: Wed Mar 23 17:25:47 2022 +0800
resolve conflicts
---
.../org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala
index eba5869..aec1a57 100644
--- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala
+++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala
@@ -738,10 +738,9 @@ class SessionCatalog(
} else {
requireDbExists(db)
if (oldName.database.isDefined || !tempViews.contains(oldTableName)) {
- requireTableExists(TableIdentifier(oldTableName, Some(db)))
- requireTableNotExists(TableIdentifier(newTableName, Some(db)))
validateName(newTableName)
- validateNewLocationOfRename(oldName, newName)
+ validateNewLocationOfRename(
+ TableIdentifier(oldTableName, Some(db)), TableIdentifier(newTableName, Some(db)))
externalCatalog.renameTable(db, oldTableName, newTableName)
} else {
if (newName.database.isDefined) {
@@ -1682,10 +1681,13 @@ class SessionCatalog(
private def validateNewLocationOfRename(
oldName: TableIdentifier,
newName: TableIdentifier): Unit = {
+ requireTableExists(oldName)
+ requireTableNotExists(newName)
val oldTable = getTableMetadata(oldName)
if (oldTable.tableType == CatalogTableType.MANAGED) {
+ assert(oldName.database.nonEmpty)
val databaseLocation =
- externalCatalog.getDatabase(oldName.database.getOrElse(currentDb)).locationUri
+ externalCatalog.getDatabase(oldName.database.get).locationUri
val newTableLocation = new Path(new Path(databaseLocation), formatTableName(newName.table))
val fs = newTableLocation.getFileSystem(hadoopConf)
if (fs.exists(newTableLocation)) {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org