jonvex commented on code in PR #11415:
URL: https://github.com/apache/hudi/pull/11415#discussion_r1632094178
##########
hudi-common/src/main/java/org/apache/hudi/common/table/read/HoodiePositionBasedFileGroupRecordBuffer.java:
##########
@@ -123,46 +142,42 @@ public void processDataBlock(HoodieDataBlock dataBlock,
Option<KeySpec> keySpecO
}
}
- @Override
- public void processNextDataRecord(T record, Map<String, Object> metadata,
Serializable recordPosition) throws IOException {
- Pair<Option<T>, Map<String, Object>> existingRecordMetadataPair =
records.get(recordPosition);
- Option<Pair<T, Map<String, Object>>> mergedRecordAndMetadata =
- doProcessNextDataRecord(record, metadata, existingRecordMetadataPair);
- if (mergedRecordAndMetadata.isPresent()) {
- records.put(recordPosition, Pair.of(
-
Option.ofNullable(readerContext.seal(mergedRecordAndMetadata.get().getLeft())),
- mergedRecordAndMetadata.get().getRight()));
+ private void fallbackToKeyBasedBuffer() {
+ readerContext.setShouldMergeUseRecordPosition(false);
+ //need to make a copy of the keys to avoid concurrent modification
exception
+ ArrayList<Serializable> positions = new ArrayList<>(records.keySet());
Review Comment:
No, those are positions. The map is recordpositon->record. After we fallback
it becomes recordkey->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]