zhangbutao commented on code in PR #10661:
URL: https://github.com/apache/iceberg/pull/10661#discussion_r1669921393


##########
mr/src/main/java/org/apache/iceberg/mr/mapreduce/IcebergInputFormat.java:
##########
@@ -144,21 +147,32 @@ public List<InputSplit> getSplits(JobContext context) {
     InputFormatConfig.InMemoryDataModel model =
         conf.getEnum(
             InputFormatConfig.IN_MEMORY_DATA_MODEL, 
InputFormatConfig.InMemoryDataModel.GENERIC);
-    try (CloseableIterable<CombinedScanTask> tasksIterable = scan.planTasks()) 
{
-      Table serializableTable = SerializableTable.copyOf(table);
-      tasksIterable.forEach(
-          task -> {
-            if (applyResidual
-                && (model == InputFormatConfig.InMemoryDataModel.HIVE
-                    || model == InputFormatConfig.InMemoryDataModel.PIG)) {
-              // TODO: We do not support residual evaluation for HIVE and PIG 
in memory data model
-              // yet
-              checkResiduals(task);
-            }
-            splits.add(new IcebergSplit(serializableTable, conf, task));
-          });
-    } catch (IOException e) {
-      throw new UncheckedIOException(String.format("Failed to close table 
scan: %s", scan), e);
+    final ExecutorService workerPool =
+        ThreadPools.newWorkerPool(
+            "iceberg-plan-worker-pool",
+            conf.getInt(
+                SystemConfigs.WORKER_THREAD_POOL_SIZE.propertyKey(),
+                ThreadPools.WORKER_THREAD_POOL_SIZE));
+    try {
+      scan = scan.planWith(workerPool);

Review Comment:
   If this change is worked, i think it is because it close the thread pool 
after the planning like 
https://github.com/apache/hive/commit/45867be6cb5308566e4cf16c7b4cf8081085b58c, 
and this can ensure that each new fetch task can use the new thread pool with 
correct ugi.
   
   Will do a test to double check this.



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