the-other-tim-brown commented on code in PR #13742:
URL: https://github.com/apache/hudi/pull/13742#discussion_r2302489488
##########
hudi-common/src/main/java/org/apache/hudi/common/table/read/BufferedRecordMergerFactory.java:
##########
@@ -338,16 +334,15 @@ public Option<DeleteRecord> deltaMerge(DeleteRecord
deleteRecord, BufferedRecord
public BufferedRecord<T> finalMerge(BufferedRecord<T> olderRecord,
BufferedRecord<T> newerRecord) throws IOException {
// TODO(HUDI-7843): decouple the merging logic from the merger
// and use the record merge mode to control how to merge partial updates
- Option<Pair<HoodieRecord, Schema>> mergedRecord =
recordMerger.get().partialMerge(
+ Pair<HoodieRecord, Schema> mergedRecord =
recordMerger.get().partialMerge(
recordContext.constructHoodieRecord(olderRecord),
recordContext.getSchemaFromBufferRecord(olderRecord),
recordContext.constructHoodieRecord(newerRecord),
recordContext.getSchemaFromBufferRecord(newerRecord),
readerSchema, props);
- if (mergedRecord.isPresent()
- &&
!mergedRecord.get().getLeft().isDelete(mergedRecord.get().getRight(), props)) {
- HoodieRecord hoodieRecord = mergedRecord.get().getLeft();
- if (!mergedRecord.get().getRight().equals(readerSchema)) {
- hoodieRecord =
hoodieRecord.rewriteRecordWithNewSchema(mergedRecord.get().getRight(), null,
readerSchema);
+ if (!mergedRecord.getLeft().isDelete(mergedRecord.getRight(), props)) {
+ HoodieRecord hoodieRecord = mergedRecord.getLeft();
+ if (!mergedRecord.getRight().equals(readerSchema)) {
+ hoodieRecord =
hoodieRecord.rewriteRecordWithNewSchema(mergedRecord.getRight(), null,
readerSchema);
Review Comment:
The lower lines will return a BufferedRecord and that will extract the
ordering field from the record
--
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]