lurnagao-dahua commented on code in PR #10661: URL: https://github.com/apache/iceberg/pull/10661#discussion_r1670390955
########## 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: > Looks good! After this change, each fetch task will new its own thread pool, so the ugi problem is gone. > > But it would be good if you can try to add a unit test. Hi, Thank you for your reply! I have been thinking for a while and believe that the unit test case for obtaining the output results already exists. But if you want to verify the fixed bug, should me grant permissions to the user to the table? I'm not sure how to grant permissions in unit test cases, May I ask if you can give me some guidance on writing unit test. Looking forward to your reply very much! -- 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