sririshindra commented on code in PR #7121:
URL: https://github.com/apache/iceberg/pull/7121#discussion_r1141194943
##########
spark/v3.3/spark-extensions/src/test/java/org/apache/iceberg/spark/extensions/TestMigrateTableProcedure.java:
##########
@@ -122,6 +122,38 @@ public void testMigrateWithDropBackup() throws IOException
{
Assert.assertFalse(spark.catalog().tableExists(tableName + "_BACKUP_"));
}
+ @Test
+ public void testMigrateWithBackupSuffix() throws IOException {
+ Assume.assumeTrue(catalogName.equals("spark_catalog"));
+ String backupSuffix = "_tmp";
+ 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);
+
+ Object result =
+ scalarSql(
+ "CALL %s.system.migrate(table => '%s', backup_suffix => '%s')",
Review Comment:
Maybe you could add a separate test for the following case as well.
```
"CALL %s.system.migrate(table => '%s', drop_backup => true, backup_suffix =>
'%s')"
```
Wouldn't hurt to test this combination as the code may change in the future
and method chaining doesn't work as expected. it might be better to add a unit
test now to ensure this doesn't cause any issues in the future. What do you
think?
--
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]