the-other-tim-brown commented on code in PR #13313:
URL: https://github.com/apache/hudi/pull/13313#discussion_r2101323193
##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/common/model/HoodieSparkRecord.java:
##########
@@ -307,7 +309,12 @@ public Option<Map<String, String>> getMetadata() {
@Override
public Option<HoodieAvroIndexedRecord> toIndexedRecord(Schema recordSchema,
Properties prop) {
- throw new UnsupportedOperationException();
+ if (data == null) {
+ return Option.empty();
+ }
+ StructType structType = schema == null ?
AvroConversionUtils.convertAvroSchemaToStructType(recordSchema) : schema;
+ GenericRecord convertedRecord =
AvroConversionUtils.createInternalRowToAvroConverter(structType, recordSchema,
false).apply(data);
+ return Option.of(new HoodieAvroIndexedRecord(key, convertedRecord));
Review Comment:
In the index utils there is a merge step that compares the values in
`mergeIncomingWithExistingRecord`
--
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]