sunchao commented on a change in pull request #2276:
URL: https://github.com/apache/iceberg/pull/2276#discussion_r589658919



##########
File path: 
spark3/src/main/java/org/apache/iceberg/spark/source/SparkBatchQueryScan.java
##########
@@ -106,26 +105,42 @@
         }
       }
 
-      if (splitSize != null) {
-        scan = scan.option(TableProperties.SPLIT_SIZE, splitSize.toString());
-      }
-
-      if (splitLookback != null) {
-        scan = scan.option(TableProperties.SPLIT_LOOKBACK, 
splitLookback.toString());
-      }
-
-      if (splitOpenFileCost != null) {
-        scan = scan.option(TableProperties.SPLIT_OPEN_FILE_COST, 
splitOpenFileCost.toString());
-      }
+      scan = scan.option(TableProperties.SPLIT_SIZE, 
String.valueOf(splitSize(scan)));
+      scan = scan.option(TableProperties.SPLIT_LOOKBACK, 
String.valueOf(splitLookback()));
+      scan = scan.option(TableProperties.SPLIT_OPEN_FILE_COST, 
String.valueOf(splitOpenFileCost()));
 
       for (Expression filter : filterExpressions()) {
         scan = scan.filter(filter);
       }
 
-      try (CloseableIterable<CombinedScanTask> tasksIterable = 
scan.planTasks()) {

Review comment:
       Thanks. Let me explore how to move this into `BaseTableScan`. One issue 
I can see is that `SparkMergeScan` currently has its own logic of planning 
tasks in its `tasks` method, instead of directly calling `TableScan.planTasks`. 
Therefore we'll need some refactoring in order to avoid duplicating the logic 
there.




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