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


##########
spark/v3.4/spark/src/main/java/org/apache/iceberg/spark/procedures/MigrateTableProcedure.java:
##########
@@ -91,15 +92,16 @@ public InternalRow[] call(InternalRow args) {
     }
 
     boolean dropBackup = args.isNullAt(2) ? false : args.getBoolean(2);
+    String backupTableName = args.isNullAt(3) ? "" : args.getString(3);

Review Comment:
   I believe to reflect the above code, the `action` parameter needs to be 
reassigned in each `if` part. In the latest commit, I update this part as below 
(because `dropBackup()` and my `backupTableName` return the 
`MigrateTableAction` type):
   
   ```java
       MigrateTableSparkAction migrateTableSparkAction =
           
SparkActions.get().migrateTable(tableName).tableProperties(properties);
   
       if (dropBackup) {
         migrateTableSparkAction = migrateTableSparkAction.dropBackup();
       }
   
       if (backupTableName != null) {
         migrateTableSparkAction = 
migrateTableSparkAction.backupTableName(backupTableName);
       }
   
       MigrateTable.Result result = migrateTableSparkAction.execute();
   ```
   
   If I misunderstand the comment, or there's more recommendation, please let 
me know.



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