nsivabalan commented on code in PR #12236:
URL: https://github.com/apache/hudi/pull/12236#discussion_r1839040074
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/BaseHoodieWriteClient.java:
##########
@@ -274,26 +317,39 @@ public boolean commitStats(String instantTime,
HoodieData<WriteStatus> writeStat
commitCallback = HoodieCommitCallbackFactory.create(config);
}
commitCallback.call(new HoodieWriteCommitCallbackMessage(
- instantTime, config.getTableName(), config.getBasePath(), stats,
Option.of(commitActionType), extraMetadata));
+ instantTime, config.getTableName(), config.getBasePath(),
dataTableStats, Option.of(commitActionType), extraMetadata));
}
return true;
}
protected void commit(HoodieTable table, String commitActionType, String
instantTime, HoodieCommitMetadata metadata,
- List<HoodieWriteStat> stats, HoodieData<WriteStatus>
writeStatuses) throws IOException {
+ List<HoodieWriteStat> dataTablestats,
List<HoodieWriteStat> mdtStats, HoodieData<WriteStatus> writeStatuses) throws
IOException {
LOG.info("Committing " + instantTime + " action " + commitActionType);
HoodieActiveTimeline activeTimeline = table.getActiveTimeline();
// Finalize write
- finalizeWrite(table, instantTime, stats);
+ finalizeWrite(table, instantTime, dataTablestats);
// do save internal schema to support Implicitly add columns in write
process
if (!metadata.getExtraMetadata().containsKey(SerDeHelper.LATEST_SCHEMA)
&& metadata.getExtraMetadata().containsKey(SCHEMA_KEY) &&
table.getConfig().getSchemaEvolutionEnable()) {
saveInternalSchema(table, instantTime, metadata);
}
+ // generate Completion time
+ String completionTime = activeTimeline.createCompletionTime();
// update Metadata table
- writeTableMetadata(table, instantTime, metadata, writeStatuses);
+ if (metadataWriterMap.containsKey(instantTime) &&
metadataWriterMap.get(instantTime).isPresent()) {
+ try {
+ // wraps the commit in MDT
+ // todo: do we need to add completion time to MDT or not yet.
+
metadataWriterMap.get(instantTime).get().writeToFilesPartitionAndCommit(instantTime,
context, mdtStats, metadata);
Review Comment:
writing to FILES partition in MDT and committing in MDT
--
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]