You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2022/09/08 01:30:47 UTC
[GitHub] [hudi] nsivabalan commented on issue #6552: [SUPPORT] AWSDmsAvroPayload does not work correctly with any version above 0.10.0
nsivabalan commented on issue #6552:
URL: https://github.com/apache/hudi/issues/6552#issuecomment-1240113529
yeah. Udit pointed out the right commit.
here is the fix that worked out for me locally.
```
diff --git a/hudi-common/src/main/java/org/apache/hudi/common/model/AWSDmsAvroPayload.java b/hudi-common/src/main/java/org/apache/hudi/common/model/AWSDmsAvroPayload.java
index 20a20fb629..a3c6dde99e 100644
--- a/hudi-common/src/main/java/org/apache/hudi/common/model/AWSDmsAvroPayload.java
+++ b/hudi-common/src/main/java/org/apache/hudi/common/model/AWSDmsAvroPayload.java
@@ -69,21 +69,21 @@ public class AWSDmsAvroPayload extends OverwriteWithLatestAvroPayload {
@Override
public Option<IndexedRecord> getInsertValue(Schema schema, Properties properties) throws IOException {
- IndexedRecord insertValue = super.getInsertValue(schema, properties).get();
- return handleDeleteOperation(insertValue);
+ Option<IndexedRecord> insertValue = super.getInsertValue(schema, properties);
+ return insertValue.isPresent() ? handleDeleteOperation(insertValue.get()) : insertValue;
}
@Override
public Option<IndexedRecord> getInsertValue(Schema schema) throws IOException {
- IndexedRecord insertValue = super.getInsertValue(schema).get();
- return handleDeleteOperation(insertValue);
+ Option<IndexedRecord> insertValue = super.getInsertValue(schema);
+ return insertValue.isPresent() ? handleDeleteOperation(insertValue.get()) : insertValue;
}
@Override
public Option<IndexedRecord> combineAndGetUpdateValue(IndexedRecord currentValue, Schema schema, Properties properties)
throws IOException {
- IndexedRecord insertValue = super.getInsertValue(schema, properties).get();
- return handleDeleteOperation(insertValue);
+ Option<IndexedRecord> insertValue = super.getInsertValue(schema, properties);
+ return insertValue.isPresent() ? handleDeleteOperation(insertValue.get()) : insertValue;
}
```
--
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