lokeshj1703 commented on code in PR #13600:
URL: https://github.com/apache/hudi/pull/13600#discussion_r2252376595
##########
hudi-common/src/main/java/org/apache/hudi/avro/AvroRecordContext.java:
##########
@@ -79,15 +90,27 @@ public String getMetaFieldValue(IndexedRecord record, int
pos) {
}
@Override
- public HoodieRecord<IndexedRecord>
constructHoodieRecord(BufferedRecord<IndexedRecord> bufferedRecord) {
+ public HoodieRecord constructHoodieRecord(BufferedRecord<IndexedRecord>
bufferedRecord) {
+ // HoodieKey is not required so do not generate it if partitionPath is null
+ HoodieKey hoodieKey = partitionPath == null ? null : new
HoodieKey(bufferedRecord.getRecordKey(), partitionPath);
+
if (bufferedRecord.isDelete()) {
- return SpillableMapUtils.generateEmptyPayload(
- bufferedRecord.getRecordKey(),
- partitionPath,
- bufferedRecord.getOrderingValue(),
- payloadClass);
+ if (payloadClass != null) {
+ return SpillableMapUtils.generateEmptyPayload(
+ bufferedRecord.getRecordKey(),
+ partitionPath,
+ bufferedRecord.getOrderingValue(),
+ payloadClass);
+ } else {
+ return new HoodieEmptyRecord<>(
+ hoodieKey,
+ HoodieRecord.HoodieRecordType.AVRO);
+ }
+ }
+ if (requiresPayloadRecords) {
Review Comment:
Its already added in the field defn.
```
// This boolean indicates whether the caller requires payloads in the
HoodieRecord conversion.
// This is temporarily required as we migrate away from payloads.
```
--
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]