linliu-code commented on code in PR #9593:
URL: https://github.com/apache/hudi/pull/9593#discussion_r1316817799
##########
hudi-common/src/main/java/org/apache/hudi/common/model/HoodieAvroRecordMerger.java:
##########
@@ -43,8 +43,11 @@ public String getMergingStrategy() {
}
@Override
- public Option<Pair<HoodieRecord, Schema>> merge(HoodieRecord older, Schema
oldSchema, HoodieRecord newer, Schema newSchema, TypedProperties props) throws
IOException {
- return combineAndGetUpdateValue(older, newer, newSchema, props)
+ public Option<Pair<HoodieRecord, Schema>> merge(Option<HoodieRecord> older,
Schema oldSchema, Option<HoodieRecord> newer, Schema newSchema, TypedProperties
props) throws IOException {
+ if (!older.isPresent() || !newer.isPresent()) {
Review Comment:
Based on the logic of `combineAndGetUpdateValue`. When `older` record is
empty, it returns Option.empty() and newer may be good; but when `older` is
good, but `newer` is empty, it will throw NullPointerException. Therefore,
`older` and `newer` have to be both good in order to produce valid result. Of
course, the logic of `combineAndGetUpdateValue` may be wrong initially and then
I can modify as you suggest.
--
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]