ConeyLiu commented on code in PR #8227:
URL: https://github.com/apache/iceberg/pull/8227#discussion_r1287898475


##########
spark/v3.4/spark-extensions/src/test/java/org/apache/iceberg/spark/extensions/TestMigrateTableProcedure.java:
##########
@@ -122,6 +122,27 @@ public void testMigrateWithDropBackup() throws IOException 
{
     Assert.assertFalse(spark.catalog().tableExists(tableName + "_BACKUP_"));
   }
 
+  @Test
+  public void testMigrateWithBackupTableName() throws IOException {
+    Assume.assumeTrue(catalogName.equals("spark_catalog"));
+    String location = temp.newFolder().toString();
+    sql(
+        "CREATE TABLE %s (id bigint NOT NULL, data string) USING parquet 
LOCATION '%s'",
+        tableName, location);
+    sql("INSERT INTO TABLE %s VALUES (1, 'a')", tableName);
+
+    String backupTableName = "backup_table";
+    Object result =
+        scalarSql(
+            "CALL %s.system.migrate(table => '%s', backup_table_name => '%s')",
+            catalogName, tableName, backupTableName);
+
+    Assert.assertEquals("Should have added one file", 1L, result);
+
+    String dbName = tableName.split("\\.")[0];
+    Assert.assertTrue(spark.catalog().tableExists(dbName + "." + 
backupTableName));

Review Comment:
   Please use `AssertJ` instead. You can refer to the contributing guide: 
https://iceberg.apache.org/contribute/#assertj



-- 
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.

To unsubscribe, e-mail: [email protected]

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