the-other-tim-brown commented on code in PR #13649:
URL: https://github.com/apache/hudi/pull/13649#discussion_r2245735136


##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/metadata/SparkHoodieBackedTableMetadataWriter.java:
##########
@@ -187,6 +187,12 @@ protected void 
bulkInsertAndCommit(BaseHoodieWriteClient<?, JavaRDD<HoodieRecord
 
   @Override
   protected void upsertAndCommit(BaseHoodieWriteClient<?, 
JavaRDD<HoodieRecord>, ?, JavaRDD<WriteStatus>> writeClient, String 
instantTime, JavaRDD<HoodieRecord> preppedRecordInputs) {
+    // When specified, reduce the parallelism of input record RDD to improve 
write performance.
+    int parallelism = 
dataWriteConfig.getMetadataConfig().getRecordPreparationParallelism();
+    if (parallelism > 0 && preppedRecordInputs.getNumPartitions() > 
parallelism) {
+      preppedRecordInputs = preppedRecordInputs.repartition(parallelism);

Review Comment:
   This docs for `repartition` mention you should use `coalesce` when reducing 
the number of partitions. 



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