ksmou commented on code in PR #9924:
URL: https://github.com/apache/hudi/pull/9924#discussion_r1373118470


##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/client/clustering/run/strategy/SparkSortAndSizeExecutionStrategy.java:
##########
@@ -68,7 +68,7 @@ public HoodieData<WriteStatus> 
performClusteringWithRecordsAsRow(Dataset<Row> in
         .withBulkInsertParallelism(numOutputGroups)
         .withProps(getWriteConfig().getProps()).build();
 
-    newConfig.setValue(HoodieStorageConfig.PARQUET_MAX_FILE_SIZE, 
String.valueOf(getWriteConfig().getClusteringMaxBytesInGroup()));
+    newConfig.setValue(HoodieStorageConfig.PARQUET_MAX_FILE_SIZE, 
String.valueOf(getWriteConfig().getClusteringTargetFileMaxBytes()));
 

Review Comment:
   Not so. If one clustering group emits 2 files, Spark will generate 2 tasks 
and write 2 files, each file's size is nearly 
`getWriteConfig().getClusteringTargetFileMaxBytes()`.
   
   In our tests, configs is :
   ```
   hoodie.clustering.plan.strategy.max.num.groups=30
   getWriteConfig().getClusteringTargetFileMaxBytes()=1073741824
   getWriteConfig().getClusteringMaxBytesInGroup()=2147483648
   newConfig.setValue(HoodieStorageConfig.PARQUET_MAX_FILE_SIZE, 
String.valueOf(getWriteConfig().getClusteringTargetFileMaxBytes()))
   ```
   
   Each clustering group emits 2 files, Spark generates 60 write tasks. And the 
final result files num is 60, each file is nearly 1g.
   
![image](https://github.com/apache/hudi/assets/135721692/6c4d86e6-25f4-491e-b4e9-f3fd7deba87f)
   
   
![image](https://github.com/apache/hudi/assets/135721692/0de7bcd7-9997-425f-8cb7-aa3f03b8b056)
   
   



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