linliu-code commented on code in PR #13623:
URL: https://github.com/apache/hudi/pull/13623#discussion_r2230976224
##########
hudi-common/src/main/java/org/apache/hudi/common/table/read/PartialUpdateStrategy.java:
##########
@@ -63,44 +68,82 @@ BufferedRecord<T> partialMerge(BufferedRecord<T> newRecord,
BufferedRecord<T> oldRecord,
Schema newSchema,
Schema oldSchema,
- boolean keepOldMetadataColumns) {
+ Schema readerSchema,
+ boolean keepOldMetadataColumns,
+ TypedProperties props) {
// Note that: When either newRecord or oldRecord is a delete record,
// skip partial update since delete records do not have
meaningful columns.
- if (partialUpdateMode == PartialUpdateMode.NONE
- || null == oldRecord
+ if (null == oldRecord
|| newRecord.isDelete()
|| oldRecord.isDelete()) {
return newRecord;
}
switch (partialUpdateMode) {
case KEEP_VALUES:
- case FILL_DEFAULTS:
- return newRecord;
+ return reconcileBasedOnKeepValues(newRecord, oldRecord, newSchema,
oldSchema, readerSchema, props);
case IGNORE_DEFAULTS:
return reconcileDefaultValues(
- newRecord, oldRecord, newSchema, oldSchema,
keepOldMetadataColumns);
- case IGNORE_MARKERS:
+ newRecord, oldRecord, newSchema, oldSchema,
keepOldMetadataColumns, false);
+ case IGNORE_DEFAULTS_NULLS:
+ return reconcileDefaultValues(newRecord, oldRecord, newSchema,
oldSchema, keepOldMetadataColumns, true);
+ case FILL_UNAVAILABLE:
return reconcileMarkerValues(
newRecord, oldRecord, newSchema, oldSchema);
default:
- return newRecord;
+ throw new HoodieIOException("Unsupported PartialUpdateMode " +
partialUpdateMode + " detected");
}
}
+ BufferedRecord<T> reconcileBasedOnKeepValues(BufferedRecord<T> newRecord,
+ BufferedRecord<T> oldRecord,
+ Schema newSchema,
+ Schema oldSchema,
+ Schema readerSchema,
+ TypedProperties props) {
+
Review Comment:
extra new line.
--
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]