nsivabalan commented on code in PR #13402:
URL: https://github.com/apache/hudi/pull/13402#discussion_r2145327418
##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/client/SparkRDDWriteClient.java:
##########
@@ -123,23 +133,35 @@ public boolean commit(String instantTime,
JavaRDD<WriteStatus> writeStatuses, Op
// At the beginning of this method, we drop all index stats and error
records before collecting in the driver.
// Just in case if there are errors, caller might be interested to fetch
error records in the validator where
// a complete collection of RDD<WriteStatus> is required.
+ JavaRDD<WriteStatus> finalWriteStatuses = writeStatuses;
boolean canProceed = writeStatusValidatorOpt.map(callback ->
callback.validate(totalRecords.get(), totalErrorRecords.get(),
- totalErrorRecords.get() > 0 ?
Option.of(HoodieJavaRDD.of(writeStatuses.filter(status ->
!status.isMetadataTable()).map(WriteStatus::removeMetadataStats))) :
Option.empty()))
+ totalErrorRecords.get() > 0 ?
Option.of(HoodieJavaRDD.of(finalWriteStatuses.filter(status ->
!status.isMetadataTable()).map(WriteStatus::removeMetadataStats))) :
Option.empty()))
.orElse(true);
// Proceeds only if validator returns true, otherwise bails out.
if (canProceed) {
// when streaming writes are enabled, writeStatuses is a mix of data
table write status and mdt write status
List<HoodieWriteStat> dataTableHoodieWriteStats =
slimWriteStatsList.stream().filter(entry ->
!entry.isMetadataTable()).map(SlimWriteStats::getWriteStat).collect(Collectors.toList());
List<HoodieWriteStat> partialMetadataHoodieWriteStatsSoFar =
slimWriteStatsList.stream().filter(entry ->
entry.isMetadataTable).map(slimWriteStats ->
slimWriteStats.getWriteStat()).collect(Collectors.toList());
Review Comment:
I don't see major difference. we can leave it as is.
--
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]