cshuo commented on code in PR #20288:
URL: https://github.com/apache/hudi/pull/20288#discussion_r4266166872
##########
hudi-client/hudi-flink-client/src/main/java/org/apache/hudi/table/format/FlinkRecordContext.java:
##########
@@ -139,8 +139,7 @@ public RowData convertAvroRecord(IndexedRecord avroRecord) {
@Override
public HoodieRecord<RowData> constructHoodieRecord(BufferedRecord<RowData>
bufferedRecord, String partitionPath) {
HoodieKey hoodieKey = new HoodieKey(bufferedRecord.getRecordKey(),
partitionPath);
- // delete record
- if (bufferedRecord.isDelete()) {
+ if (bufferedRecord.isDelete() && bufferedRecord.isEmpty()) {
Review Comment:
Spark's record context has similar logic: it currently converts all delete
records into HoodieEmptyRecord, so it should receive the same adjustment.
Avro's record context already matches this PR—it creates an empty record only
when the buffered record is a delete and its payload is null.
I think HoodieEmptyRecord should continue to represent a delete with an
empty payload, rather than being restricted to commit-time ordering. An empty
tombstone can still carry an event-time ordering value, for example when read
from a delete log. When the payload is present, we should retain the
engine-specific record so its ordering-value conversion remains available.
--
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]