linliu-code commented on code in PR #13498:
URL: https://github.com/apache/hudi/pull/13498#discussion_r2187813529
##########
hudi-common/src/main/java/org/apache/hudi/common/engine/HoodieReaderContext.java:
##########
@@ -280,15 +285,11 @@ public ClosableIterator<T> getFileRecordIterator(
public void initRecordMerger(TypedProperties properties) {
RecordMergeMode recordMergeMode = tableConfig.getRecordMergeMode();
String mergeStrategyId = tableConfig.getRecordMergeStrategyId();
- if
(!tableConfig.getTableVersion().greaterThanOrEquals(HoodieTableVersion.EIGHT)) {
- Triple<RecordMergeMode, String, String> triple =
HoodieTableConfig.inferCorrectMergingBehavior(
- recordMergeMode, tableConfig.getPayloadClass(),
- mergeStrategyId, null, tableConfig.getTableVersion());
- recordMergeMode = triple.getLeft();
- mergeStrategyId = triple.getRight();
- }
- this.mergeMode = recordMergeMode;
- this.recordMerger = getRecordMerger(recordMergeMode, mergeStrategyId,
+ Triple<RecordMergeMode, String, String> triple =
HoodieTableConfig.inferCorrectMergingBehavior(
Review Comment:
Actually we should call infer function for == 9. Why? because when table
version is 9, if the payload class is not null, the merge mode should be
inferred and the resulting merge mode is likely different from that from
version 8 due to payload deprecation. E.g., for postgres payload, the merge
mode is CUSTOM in version 8, which in EVENT_TIME_ORDERGING in version 9.
Therefore, when table version == 9, we should do inference.
If we want to keep current behavior for table version 8, then we should do:
`(tableConfig.getTableVersion().versionCode < EIGHT.versionCode ||
tableConfig.getTableVersion().versionCode > EIGHT.versionCode)`
--
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]