yihua commented on code in PR #12232:
URL: https://github.com/apache/hudi/pull/12232#discussion_r1883346110
##########
hudi-common/src/main/java/org/apache/hudi/common/model/PartialUpdateAvroPayload.java:
##########
@@ -130,23 +130,17 @@ public PartialUpdateAvroPayload(Option<GenericRecord>
record) {
}
@Override
- public PartialUpdateAvroPayload preCombine(OverwriteWithLatestAvroPayload
oldValue, Schema schema, Properties properties) {
+ public PartialUpdateAvroPayload preCombine(OverwriteWithLatestAvroPayload
oldValue, Schema schema, Properties properties) throws IOException {
if (oldValue.recordBytes.length == 0) {
// use natural order for deleted record
return this;
}
// pick the payload with greater ordering value as insert record
final boolean shouldPickOldRecord =
oldValue.orderingVal.compareTo(orderingVal) > 0;
- try {
- GenericRecord oldRecord =
HoodieAvroUtils.bytesToAvro(oldValue.recordBytes, schema);
- Option<IndexedRecord> mergedRecord = mergeOldRecord(oldRecord, schema,
shouldPickOldRecord, true);
- if (mergedRecord.isPresent()) {
- return new PartialUpdateAvroPayload((GenericRecord) mergedRecord.get(),
- shouldPickOldRecord ? oldValue.orderingVal : this.orderingVal);
- }
- } catch (Exception ex) {
- LOG.warn("PartialUpdateAvroPayload precombine failed with ", ex);
- return this;
+ GenericRecord oldRecord =
HoodieAvroUtils.bytesToAvro(oldValue.recordBytes, schema);
+ Option<IndexedRecord> mergedRecord = mergeOldRecord(oldRecord, schema,
shouldPickOldRecord, true);
+ if (mergedRecord.isPresent()) {
+ return new PartialUpdateAvroPayload((GenericRecord) mergedRecord.get(),
shouldPickOldRecord ? oldValue.orderingVal : this.orderingVal);
Review Comment:
+1. Let's add a unit test on the error/exception handling.
--
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]