danny0405 commented on code in PR #12390:
URL: https://github.com/apache/hudi/pull/12390#discussion_r1865576232
##########
hudi-common/src/main/java/org/apache/hudi/common/table/read/HoodieBaseFileGroupRecordBuffer.java:
##########
@@ -495,14 +502,24 @@ protected boolean hasNextBaseRecord(T baseRecord,
Pair<Option<T>, Map<String, Ob
Map<String, Object> metadata = readerContext.generateMetadataForRecord(
baseRecord, readerSchema);
- Option<T> resultRecord = logRecordInfo != null
- ? merge(Option.of(baseRecord), metadata, logRecordInfo.getLeft(),
logRecordInfo.getRight())
- : merge(Option.empty(), Collections.emptyMap(), Option.of(baseRecord),
metadata);
- if (resultRecord.isPresent()) {
- nextRecord = readerContext.seal(resultRecord.get());
- return true;
+ if (logRecordInfo != null) {
+ Option<T> resultRecord = merge(Option.of(baseRecord), metadata,
logRecordInfo.getLeft(), logRecordInfo.getRight());
+ if (resultRecord.isPresent()) {
+ // Updates
Review Comment:
It does not look right to only do the stats while iterating over the base
file records, the log file could also contain inserts/updates/deletes. If this
logic is in sync with the old reader, we should be good now, just need to fix
it in the future.
Re-confirm: the `HoodieMergeHandle` has a stat for `insertRecordsWritten`,
we should be good here.
--
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]