SteNicholas commented on code in PR #9395:
URL: https://github.com/apache/hudi/pull/9395#discussion_r1288326850


##########
hudi-client/hudi-flink-client/src/main/java/org/apache/hudi/client/common/HoodieFlinkEngineContext.java:
##########
@@ -102,12 +102,12 @@ public RuntimeContext getRuntimeContext() {
 
   @Override
   public <I, O> List<O> map(List<I> data, SerializableFunction<I, O> func, int 
parallelism) {
-    return 
data.stream().parallel().map(throwingMapWrapper(func)).collect(Collectors.toList());
+    return stream(data, 
parallelism).map(throwingMapWrapper(func)).collect(Collectors.toList());
   }

Review Comment:
   @stream2000, I don't think only run the map function sequentially. In order 
to reduce the OOM risk caused by parallelization, all functions should be 
handled in this way. For example, when the parallelism is 1000, the 
`CleanPlanActionExecutor` uses map function and may casue `OutOfMemoryError` 
for many filegroups in `stream().parallel()`, which stacktrace like above 
description. BTW, the parallel stream only improves a little performance, 
therefore this change doesn't destroy much performance improvement.



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

Reply via email to