Zouxxyy commented on code in PR #9275:
URL: https://github.com/apache/hudi/pull/9275#discussion_r1280071700


##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/table/action/bootstrap/SparkBootstrapCommitActionExecutor.java:
##########
@@ -223,47 +221,11 @@ protected void commit(Option<Map<String, String>> 
extraMetadata, HoodieWriteMeta
       LOG.info("Finished writing bootstrap index for source " + 
config.getBootstrapSourceBasePath() + " in table "
           + config.getBasePath());
     }
-
-    commit(extraMetadata, result, bootstrapSourceAndStats.values().stream()
+    commit(result.getWriteStatuses(), result, 
bootstrapSourceAndStats.values().stream()
         .flatMap(f -> 
f.stream().map(Pair::getValue)).collect(Collectors.toList()));
     LOG.info("Committing metadata bootstrap !!");
   }
 
-  protected void commit(Option<Map<String, String>> extraMetadata, 
HoodieWriteMetadata<HoodieData<WriteStatus>> result, List<HoodieWriteStat> 
stats) {
-    String actionType = table.getMetaClient().getCommitActionType();
-    LOG.info("Committing " + instantTime + ", action Type " + actionType);
-    // Create a Hoodie table which encapsulated the commits and files visible
-    HoodieSparkTable table = HoodieSparkTable.create(config, context);
-
-    HoodieActiveTimeline activeTimeline = table.getActiveTimeline();
-    HoodieCommitMetadata metadata = new HoodieCommitMetadata();
-
-    result.setCommitted(true);
-    stats.forEach(stat -> metadata.addWriteStat(stat.getPartitionPath(), 
stat));
-    result.setWriteStats(stats);
-
-    // Finalize write
-    finalizeWrite(instantTime, stats, result);
-    // add in extra metadata
-    if (extraMetadata.isPresent()) {

Review Comment:
   
![image](https://github.com/apache/hudi/assets/37108074/010d7ec6-8a96-417a-8dc3-65b8189bf2a5)
   
   The build of metadata is completed in this step, and the extra metadata has 
been filled in here. There are two reasons for this:
   
   1. These values will not change in the follow steps
   2. In addition to bootstrap, other operations are done in this way



-- 
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: commits-unsubscr...@hudi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to