the-other-tim-brown commented on code in PR #13688:
URL: https://github.com/apache/hudi/pull/13688#discussion_r2261277788
##########
hudi-common/src/main/java/org/apache/hudi/common/table/read/buffer/StreamingFileGroupRecordBufferLoader.java:
##########
@@ -66,12 +72,26 @@ public Pair<HoodieFileGroupRecordBuffer<T>, List<String>>
getRecordBuffer(Hoodie
readerContext, hoodieTableMetaClient, readerContext.getMergeMode(),
partialUpdateMode, props, orderingFieldNames, updateProcessor);
}
- Iterator<BufferedRecord> recordIterator = inputSplit.getRecordIterator();
-
+ RecordContext<T> recordContext = readerContext.getRecordContext();
+ Schema recordSchema = readerContext.getSchemaHandler().getTableSchema();
+ Iterator<HoodieRecord> recordIterator = inputSplit.getRecordIterator();
+ String[] orderingFieldsArray = orderingFieldNames.toArray(new String[0]);
while (recordIterator.hasNext()) {
- BufferedRecord bufferedRecord = recordIterator.next();
+ HoodieRecord hoodieRecord = recordIterator.next();
+ T data = recordContext.extractDataFromRecord(hoodieRecord, recordSchema,
props);
try {
- recordBuffer.processNextDataRecord(bufferedRecord,
bufferedRecord.getRecordKey());
+ if (data == null) {
+ DeleteRecord deleteRecord =
DeleteRecord.create(hoodieRecord.getKey(),
hoodieRecord.getOrderingValue(recordSchema, props, orderingFieldsArray));
+ recordBuffer.processNextDeletedRecord(deleteRecord,
deleteRecord.getRecordKey());
+ } else {
+ // HoodieRecord#isDelete does not check if a record is a DELETE
marked by a custom delete marker,
Review Comment:
We still need to check the `HoodieRecord#isDelete` when there is a custom
payload used. The user may have implemented custom logic in their payload that
does not follow the standard conventions. Is there a way to incorporate this
into the AvroRecordContext? That should be the only pathway that can encounter
a `HoodieAvroRecord` which contains a payload.
--
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]