slfan1989 commented on code in PR #12783:
URL: https://github.com/apache/iceberg/pull/12783#discussion_r2047150494


##########
spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/procedures/SnapshotTableProcedure.java:
##########
@@ -104,8 +106,8 @@ public InternalRow[] call(InternalRow args) {
       action.tableLocation(snapshotLocation);
     }
 
-    if (!args.isNullAt(4)) {
-      int parallelism = args.getInt(4);
+    Integer parallelism = input.asInt(PARALLELISM_PARAM, null);
+    if (parallelism != null) {

Review Comment:
   Thank you for your suggestion! Your modification has made the validation 
logic simpler. However, I have a small concern. `parallelism` may be null, but 
we must ensure that `parallelism != null` in order to execute `action = 
action.executeWith(SparkTableUtil.migrationService(parallelism))`. If 
`parallelism` is null, subsequent code may throw an exception.
   
   
https://github.com/apache/iceberg/blob/013d09e473faada1a3b21c155964ec4d1254d69d/spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/SparkTableUtil.java#L990-L993



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to