You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "yihua (via GitHub)" <gi...@apache.org> on 2023/05/11 14:26:40 UTC

[GitHub] [hudi] yihua opened a new pull request, #8690: [WIP][HUDI-6199] Fix deletes with custom payload implementation

yihua opened a new pull request, #8690:
URL: https://github.com/apache/hudi/pull/8690

   ### Change Logs
   
   Delete operation in custom payload after RFC-46: while looking into a 0.13.1 release [blocker](https://github.com/apache/hudi/pull/8573), 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.
   
   ### Impact
   
   _Describe any public API or user-facing feature change or any performance impact._
   
   ### Risk level (write none, low medium or high below)
   
   _If medium or high, explain what verification was done to mitigate the risks._
   
   ### Documentation Update
   
   _Describe any necessary documentation update if there is any new feature, config, or user-facing change_
   
   - _The config description must be updated if new configs are added or the default value of the configs are changed_
   - _Any new feature or user-facing change requires updating the Hudi website. Please create a Jira ticket, attach the
     ticket number here and follow the [instruction](https://hudi.apache.org/contribute/developer-setup#website) to make
     changes to the website._
   
   ### Contributor's checklist
   
   - [ ] Read through [contributor's guide](https://hudi.apache.org/contribute/how-to-contribute)
   - [ ] Change Logs and Impact were stated clearly
   - [ ] Adequate tests were added if applicable
   - [ ] CI passed
   


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] xushiyan commented on a diff in pull request #8690: [HUDI-6199] Fix deletes with custom payload implementation

Posted by "xushiyan (via GitHub)" <gi...@apache.org>.
xushiyan commented on code in PR #8690:
URL: https://github.com/apache/hudi/pull/8690#discussion_r1193713591


##########
hudi-common/src/main/java/org/apache/hudi/common/model/debezium/AbstractDebeziumAvroPayload.java:
##########
@@ -91,4 +91,14 @@ private Option<IndexedRecord> handleDeleteOperation(IndexedRecord insertRecord)
   private Option<IndexedRecord> getInsertRecord(Schema schema) throws IOException {
     return super.getInsertValue(schema);
   }
+
+  @Override
+  protected boolean isDeleteRecord(GenericRecord record) {
+    return isDebeziumDeleteRecord(record) || super.isDeleteRecord(record);
+  }
+
+  private boolean isDebeziumDeleteRecord(GenericRecord record) {

Review Comment:
   can be static too



##########
hudi-common/src/main/java/org/apache/hudi/common/model/AWSDmsAvroPayload.java:
##########
@@ -94,4 +94,13 @@ public Option<IndexedRecord> combineAndGetUpdateValue(IndexedRecord currentValue
     }
     return handleDeleteOperation(insertValue.get());
   }
+
+  @Override
+  protected boolean isDeleteRecord(GenericRecord record) {
+    return isDMSDeleteRecord(record) || super.isDeleteRecord(record);
+  }
+
+  private boolean isDMSDeleteRecord(GenericRecord record) {

Review Comment:
   this can be static



-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] hudi-bot commented on pull request #8690: [HUDI-6199] Fix deletes with custom payload implementation

Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #8690:
URL: https://github.com/apache/hudi/pull/8690#issuecomment-1547811566

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "042b47a253141773fef79156777f2f2eef48af7c",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=17068",
       "triggerID" : "042b47a253141773fef79156777f2f2eef48af7c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "201f5fb5370b3f41f2d8a8f947a2c8bdf3f550cb",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=17080",
       "triggerID" : "201f5fb5370b3f41f2d8a8f947a2c8bdf3f550cb",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 042b47a253141773fef79156777f2f2eef48af7c Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=17068) 
   * 201f5fb5370b3f41f2d8a8f947a2c8bdf3f550cb Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=17080) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] yihua commented on a diff in pull request #8690: [WIP][HUDI-6199] Fix deletes with custom payload implementation

Posted by "yihua (via GitHub)" <gi...@apache.org>.
yihua commented on code in PR #8690:
URL: https://github.com/apache/hudi/pull/8690#discussion_r1192793403


##########
hudi-common/src/main/java/org/apache/hudi/common/model/debezium/AbstractDebeziumAvroPayload.java:
##########
@@ -91,4 +90,14 @@ private Option<IndexedRecord> handleDeleteOperation(IndexedRecord insertRecord)
   private Option<IndexedRecord> getInsertRecord(Schema schema) throws IOException {
     return super.getInsertValue(schema);
   }
+
+  @Override
+  protected boolean isDeleteRecord(GenericRecord record) {
+    return isDebeziumDeleteRecord(record) || super.isDeleteRecord(record);
+  }
+
+  private boolean isDebeziumDeleteRecord(GenericRecord record) {

Review Comment:
   Some payload may not want to leverage _hoodie_is_deleted.  Your code example will not allow this.



-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] nsivabalan commented on a diff in pull request #8690: [WIP][HUDI-6199] Fix deletes with custom payload implementation

Posted by "nsivabalan (via GitHub)" <gi...@apache.org>.
nsivabalan commented on code in PR #8690:
URL: https://github.com/apache/hudi/pull/8690#discussion_r1192800728


##########
hudi-common/src/main/java/org/apache/hudi/common/model/debezium/AbstractDebeziumAvroPayload.java:
##########
@@ -91,4 +90,14 @@ private Option<IndexedRecord> handleDeleteOperation(IndexedRecord insertRecord)
   private Option<IndexedRecord> getInsertRecord(Schema schema) throws IOException {
     return super.getInsertValue(schema);
   }
+
+  @Override
+  protected boolean isDeleteRecord(GenericRecord record) {
+    return isDebeziumDeleteRecord(record) || super.isDeleteRecord(record);
+  }
+
+  private boolean isDebeziumDeleteRecord(GenericRecord record) {

Review Comment:
   sg



-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] hudi-bot commented on pull request #8690: [HUDI-6199] Fix deletes with custom payload implementation

Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #8690:
URL: https://github.com/apache/hudi/pull/8690#issuecomment-1547280222

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "042b47a253141773fef79156777f2f2eef48af7c",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=17068",
       "triggerID" : "042b47a253141773fef79156777f2f2eef48af7c",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 042b47a253141773fef79156777f2f2eef48af7c Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=17068) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] hudi-bot commented on pull request #8690: [HUDI-6199] Fix deletes with custom payload implementation

Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #8690:
URL: https://github.com/apache/hudi/pull/8690#issuecomment-1547521571

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "042b47a253141773fef79156777f2f2eef48af7c",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=17068",
       "triggerID" : "042b47a253141773fef79156777f2f2eef48af7c",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 042b47a253141773fef79156777f2f2eef48af7c Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=17068) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] yihua merged pull request #8690: [HUDI-6199] Fix deletes with custom payload implementation

Posted by "yihua (via GitHub)" <gi...@apache.org>.
yihua merged PR #8690:
URL: https://github.com/apache/hudi/pull/8690


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] hudi-bot commented on pull request #8690: [HUDI-6199] Fix deletes with custom payload implementation

Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #8690:
URL: https://github.com/apache/hudi/pull/8690#issuecomment-1547273604

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "042b47a253141773fef79156777f2f2eef48af7c",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "042b47a253141773fef79156777f2f2eef48af7c",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 042b47a253141773fef79156777f2f2eef48af7c UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] hudi-bot commented on pull request #8690: [HUDI-6199] Fix deletes with custom payload implementation

Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #8690:
URL: https://github.com/apache/hudi/pull/8690#issuecomment-1547799054

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "042b47a253141773fef79156777f2f2eef48af7c",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=17068",
       "triggerID" : "042b47a253141773fef79156777f2f2eef48af7c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "201f5fb5370b3f41f2d8a8f947a2c8bdf3f550cb",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "201f5fb5370b3f41f2d8a8f947a2c8bdf3f550cb",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 042b47a253141773fef79156777f2f2eef48af7c Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=17068) 
   * 201f5fb5370b3f41f2d8a8f947a2c8bdf3f550cb UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] yihua commented on a diff in pull request #8690: [HUDI-6199] Fix deletes with custom payload implementation

Posted by "yihua (via GitHub)" <gi...@apache.org>.
yihua commented on code in PR #8690:
URL: https://github.com/apache/hudi/pull/8690#discussion_r1193990904


##########
hudi-common/src/main/java/org/apache/hudi/common/model/debezium/AbstractDebeziumAvroPayload.java:
##########
@@ -91,4 +91,14 @@ private Option<IndexedRecord> handleDeleteOperation(IndexedRecord insertRecord)
   private Option<IndexedRecord> getInsertRecord(Schema schema) throws IOException {
     return super.getInsertValue(schema);
   }
+
+  @Override
+  protected boolean isDeleteRecord(GenericRecord record) {
+    return isDebeziumDeleteRecord(record) || super.isDeleteRecord(record);
+  }
+
+  private boolean isDebeziumDeleteRecord(GenericRecord record) {

Review Comment:
   +1



##########
hudi-common/src/main/java/org/apache/hudi/common/model/AWSDmsAvroPayload.java:
##########
@@ -94,4 +94,13 @@ public Option<IndexedRecord> combineAndGetUpdateValue(IndexedRecord currentValue
     }
     return handleDeleteOperation(insertValue.get());
   }
+
+  @Override
+  protected boolean isDeleteRecord(GenericRecord record) {
+    return isDMSDeleteRecord(record) || super.isDeleteRecord(record);
+  }
+
+  private boolean isDMSDeleteRecord(GenericRecord record) {

Review Comment:
   Makes sense.  I see you've fixed it.



-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] nsivabalan commented on a diff in pull request #8690: [WIP][HUDI-6199] Fix deletes with custom payload implementation

Posted by "nsivabalan (via GitHub)" <gi...@apache.org>.
nsivabalan commented on code in PR #8690:
URL: https://github.com/apache/hudi/pull/8690#discussion_r1192602586


##########
hudi-common/src/main/java/org/apache/hudi/common/model/debezium/AbstractDebeziumAvroPayload.java:
##########
@@ -91,4 +90,14 @@ private Option<IndexedRecord> handleDeleteOperation(IndexedRecord insertRecord)
   private Option<IndexedRecord> getInsertRecord(Schema schema) throws IOException {
     return super.getInsertValue(schema);
   }
+
+  @Override
+  protected boolean isDeleteRecord(GenericRecord record) {
+    return isDebeziumDeleteRecord(record) || super.isDeleteRecord(record);
+  }
+
+  private boolean isDebeziumDeleteRecord(GenericRecord record) {

Review Comment:
   should we introduce something like 
   ```
   isCustomDeleteRecord() 
   ```
   in BaseAbroPayload 
   which will by default return false. 
   
   And impl of IsDeleteRecord in BaseAvroPayload will be 
   ```
   protected boolean isDeleteRecord(GenericRecord record) {
       return isCustomDeleteRecord(record) || isDeleteRecordInternal(record);
     }
   ```
   
   I am just trying to avoid calling super.isDeleteRecord in every custom payload. 
   
   with this, every custom payload just needs to override isCustomDeleteRecord. 
   
   
   
   
   
   
   



-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org