You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "yihua (via GitHub)" <gi...@apache.org> on 2023/08/30 23:52:42 UTC
[GitHub] [hudi] yihua commented on a diff in pull request #9572: [WIP][HUDI-6702]Utilize merger to replace insertValue api
yihua commented on code in PR #9572:
URL: https://github.com/apache/hudi/pull/9572#discussion_r1310956732
##########
hudi-common/src/main/java/org/apache/hudi/common/model/HoodieAvroRecord.java:
##########
@@ -184,16 +185,20 @@ public HoodieRecord<T> copy() {
@Override
public HoodieRecord wrapIntoHoodieRecordPayloadWithParams(
- Schema recordSchema, Properties props,
+ Schema recordSchema,
+ Properties props,
Option<Pair<String, String>> simpleKeyGenFieldsOpt,
Boolean withOperation,
Option<String> partitionNameOp,
Boolean populateMetaFields,
Option<Schema> schemaWithoutMetaFields) throws IOException {
- IndexedRecord indexedRecord = (IndexedRecord) data.getInsertValue(recordSchema, props).get();
+ HoodieAvroRecordMerger merger = HoodieAvroRecordMerger.INSTANCE;
+ HoodieAvroIndexedRecord record = (HoodieAvroIndexedRecord) merger.merge(
Review Comment:
Let's change the merge API to
```
Option<Pair<HoodieRecord, Schema>> merge(Option<HoodieRecord> older, Schema oldSchema, Option<HoodieRecord> newer, Schema newSchema, TypedProperties props)
```
so that we pass in `Option.empty` instead of `null`.
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org