-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[HUDI-6199] Fix deletes with custom payload implementation #8690
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nsivabalan
reviewed
May 12, 2023
...-common/src/main/java/org/apache/hudi/common/model/debezium/AbstractDebeziumAvroPayload.java
Outdated
Show resolved
Hide resolved
ad450cd to
042b47a
Compare
xushiyan
approved these changes
May 15, 2023
hudi-common/src/main/java/org/apache/hudi/common/model/AWSDmsAvroPayload.java
Outdated
Show resolved
Hide resolved
...-common/src/main/java/org/apache/hudi/common/model/debezium/AbstractDebeziumAvroPayload.java
Outdated
Show resolved
Hide resolved
Contributor
Author
Collaborator
yihua
added a commit
to yihua/hudi
that referenced
this pull request
May 15, 2023
There was a bug that the delete records are assumed to be marked by "_hoodie_is_deleted"; however, custom CDC payloads use "op" field to mark deletes. In such a case, AWS DMS payload and Debezium payload failed with deletes. This commit fixes the issue by adding a new API isDeleteRecord(GenericRecord genericRecord) in BaseAvroPayload to allow the payload to implement custom logic to indicate if a record is a delete record. Co-authored-by: Raymond Xu <[email protected]>
yihua
added a commit
to yihua/hudi
that referenced
this pull request
May 15, 2023
There was a bug that the delete records are assumed to be marked by "_hoodie_is_deleted"; however, custom CDC payloads use "op" field to mark deletes. In such a case, AWS DMS payload and Debezium payload failed with deletes. This commit fixes the issue by adding a new API isDeleteRecord(GenericRecord genericRecord) in BaseAvroPayload to allow the payload to implement custom logic to indicate if a record is a delete record. Co-authored-by: Raymond Xu <[email protected]>
yihua
added a commit
to yihua/hudi
that referenced
this pull request
May 17, 2023
There was a bug that the delete records are assumed to be marked by "_hoodie_is_deleted"; however, custom CDC payloads use "op" field to mark deletes. In such a case, AWS DMS payload and Debezium payload failed with deletes. This commit fixes the issue by adding a new API isDeleteRecord(GenericRecord genericRecord) in BaseAvroPayload to allow the payload to implement custom logic to indicate if a record is a delete record. Co-authored-by: Raymond Xu <[email protected]>
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

Change Logs
Delete operation in custom payload after RFC-46: while looking into a 0.13.1 release blocker, I found that custom payload implementation like AWS DMS payload and Debezium payload are not properly migrated to the new APIs introduced by RFC-46, causing the delete operation to fail. Our tests did not catch this.
It is currently assumed that delete records are marked by "_hoodie_is_deleted"; however, custom CDC payloads use op field to mark deletes.
This PR fixes the issue by adding a new API
isDeleteRecord(GenericRecord genericRecord)inBaseAvroPayloadto allow the payload to implement custom logic to indicate if a record is a delete record.Impact
Fixes the failure when the custom payload uses another field to identify deletes.
Risk level
low
Documentation Update
Need to update 0.13.0 release notes to indicate the regression.
Contributor's checklist