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


##########
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:
   I move part of them which related to `ConsistentBucketIndex`  to 
`SparkInsertOverwritePartitioner`.
   And I left other part which related to `SimpleBucketIndex` in 
`SparkBucketIndexInsertOverwritePartitioner`.
   Because SimpleBucketIndex and ConsistentBucketIndex are different when 
creates new `BucketInfo`.
   



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