cloud-fan commented on a change in pull request #30935:
URL: https://github.com/apache/spark/pull/30935#discussion_r549225402



##########
File path: 
sql/core/src/test/scala/org/apache/spark/sql/execution/command/AlterTableRenamePartitionSuiteBase.scala
##########
@@ -17,8 +17,149 @@
 
 package org.apache.spark.sql.execution.command
 
-import org.apache.spark.sql.QueryTest
+import org.apache.spark.sql.{AnalysisException, QueryTest, Row}
+import org.apache.spark.sql.catalyst.analysis.{NoSuchPartitionException, 
PartitionAlreadyExistsException}
+import org.apache.spark.sql.internal.SQLConf
 
 trait AlterTableRenamePartitionSuiteBase extends QueryTest with 
DDLCommandTestUtils {
   override val command = "ALTER TABLE .. RENAME PARTITION"
+
+  protected def createSinglePartTable(t: String): Unit = {
+    sql(s"CREATE TABLE $t (id bigint, data string) $defaultUsing PARTITIONED 
BY (id)")
+    sql(s"INSERT INTO $t PARTITION (id = 1) SELECT 'abc'")
+  }
+
+  test("rename without explicitly specifying database") {
+    withNamespaceAndTable("ns", "tbl") { t =>
+      createSinglePartTable(t)
+      checkPartitions(t, Map("id" -> "1"))
+
+      sql(s"ALTER TABLE $t PARTITION (id = 1) RENAME TO PARTITION (id = 2)")

Review comment:
       `$t` does include the database, right?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to