nsivabalan commented on code in PR #9114:
URL: https://github.com/apache/hudi/pull/9114#discussion_r1250983854
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadataWriter.java:
##########
@@ -1159,10 +1161,30 @@ protected boolean
validateTimelineBeforeSchedulingCompaction(Option<String> inFl
* @param writeStatuses {@code WriteStatus} from the write operation
*/
private HoodieData<HoodieRecord>
getRecordIndexUpdates(HoodieData<WriteStatus> writeStatuses) {
- return writeStatuses.flatMap(writeStatus -> {
- List<HoodieRecord> recordList = new LinkedList<>();
- for (HoodieRecordDelegate recordDelegate :
writeStatus.getWrittenRecordDelegates()) {
- if (!writeStatus.isErrored(recordDelegate.getHoodieKey())) {
+ // 1. List<HoodieRecordDelegate>
+ // 2. Reduce by key: accept keys only when new location is not
+ return writeStatuses.map(writeStatus ->
writeStatus.getWrittenRecordDelegates().stream().map(recordDelegate ->
Pair.of(writeStatus, recordDelegate)))
+ .flatMapToPair(Stream::iterator)
Review Comment:
before calling reduce By key, shouldn't we do KeyBy record key for all
recordDelegate and then call reduceByKey.
--
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]