linliu-code commented on code in PR #9819:
URL: https://github.com/apache/hudi/pull/9819#discussion_r1353657462
##########
hudi-common/src/main/java/org/apache/hudi/common/table/log/HoodieMergedLogRecordReader.java:
##########
@@ -230,6 +242,34 @@ public void processNextRecord(T record, Map<String,
Object> metadata) throws IOE
}
}
+ @Override
+ public void processNextRecordWithPosition(T record,
+ Map<String, Object> metadata,
+ int sequenceNo,
+ List<Integer> positions) throws
IOException {
+ String key = (String)
metadata.get(HoodieReaderContext.INTERNAL_META_RECORD_KEY);
+ int position = positions.get(sequenceNo);
+ // No position information is found for this record.
+ if (position < 0) {
+ throw new IOException("No position information is found for the record "
+ key);
+ }
+
+ Pair<Option<T>, Map<String, Object>> existingRecordMetadataPair =
positionToRecords.get(position);
+ if (existingRecordMetadataPair != null) {
+ HoodieRecord<T> combinedRecord = (HoodieRecord<T>) recordMerger.merge(
+ readerContext.constructHoodieRecord(Option.of(record), metadata,
readerSchema),
+ readerSchema,
+
readerContext.constructHoodieRecord(existingRecordMetadataPair.getLeft(),
existingRecordMetadataPair.getRight(), readerSchema),
+ readerSchema,
+ this.getPayloadProps()).get().getLeft();
Review Comment:
I saw the Ethan's PR, which is based on precombine field name. Which one
should I use?
--
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]