danny0405 commented on code in PR #8072:
URL: https://github.com/apache/hudi/pull/8072#discussion_r1122591655


##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/table/action/commit/SparkInsertOverwriteCommitActionExecutor.java:
##########
@@ -65,9 +70,21 @@ public HoodieWriteMetadata<HoodieData<WriteStatus>> 
execute() {
 
   @Override
   protected Partitioner getPartitioner(WorkloadProfile profile) {
-    return table.getStorageLayout().layoutPartitionerClass()
-        .map(c -> getLayoutPartitioner(profile, c))
-        .orElse(new SparkInsertOverwritePartitioner(profile, context, table, 
config));
+    // Fix HUDI-5857, insert overwrite should generate new file group id
+    if (config.getIndexType().equals(BUCKET)) {
+      switch (config.getBucketIndexEngineType()) {
+        case SIMPLE:
+          return new SparkInsertOverwriteSimpleBucketIndexPartitioner(profile, 
context, table, config);
+        case CONSISTENT_HASHING:
+          return new 
SparkInsertOverwriteConsistentBucketIndexPartitioner(profile, context, table, 
config);
+        default:
+          throw new HoodieNotSupportedException("Unknown bucket index engine 
type: " + config.getBucketIndexEngineType());

Review Comment:
   Can we inline all the different handling for `getBucketInfo` into 
`SparkInsertOverwritePartitioner` ? Let's make the code cleaner.



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