nsivabalan commented on code in PR #13615:
URL: https://github.com/apache/hudi/pull/13615#discussion_r2274613062
##########
hudi-common/src/main/java/org/apache/hudi/common/model/HoodieRecordPayload.java:
##########
@@ -182,16 +184,32 @@ static String getPayloadClassName(HoodieConfig config) {
}
static String getPayloadClassName(Properties props) {
- return
getPayloadClassNameIfPresent(props).orElse(HoodieTableConfig.DEFAULT_PAYLOAD_CLASS_NAME);
+ Option<String> payloadOpt = getPayloadClassNameIfPresent(props);
+ if (payloadOpt.isPresent()) {
+ return payloadOpt.get();
+ }
+ // Note: starting from version 9, payload class is not necessary set, but
+ // merge mode must exist. Therefore, we use merge mode to infer
+ // the payload class for certain corner cases, like for MIT command.
+ if (props.containsKey(RECORD_MERGE_MODE.key())
+ &&
props.getProperty(RECORD_MERGE_MODE.key()).equals(RecordMergeMode.COMMIT_TIME_ORDERING.name()))
{
+ return OverwriteWithLatestAvroPayload.class.getName();
+ }
+ return DEFAULT_PAYLOAD_CLASS_NAME;
}
+ // NOTE: PAYLOAD_CLASS_NAME is before LEGACY_PAYLOAD_CLASS_NAME to make sure
+ // some temporary payload class setting is respect.
static Option<String> getPayloadClassNameIfPresent(Properties props) {
String payloadClassName = null;
if (props.containsKey(PAYLOAD_CLASS_NAME.key())) {
payloadClassName = props.getProperty(PAYLOAD_CLASS_NAME.key());
+ } else if (props.containsKey(LEGACY_PAYLOAD_CLASS_NAME.key())) {
Review Comment:
Since we have not yet fixed entire [write path to support non payload
ways](https://issues.apache.org/jira/browse/HUDI-9713), we have to go w/ this
fix for time being.
We are filing a follow up jira to fix this.
https://issues.apache.org/jira/browse/HUDI-9712
--
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]