wzx140 commented on code in PR #5522:
URL: https://github.com/apache/hudi/pull/5522#discussion_r894257972


##########
hudi-common/src/main/java/org/apache/hudi/common/model/HoodieAvroRecord.java:
##########
@@ -40,11 +62,192 @@ public HoodieRecord<T> newInstance() {
     return new HoodieAvroRecord<>(this);
   }
 
+  @Override
+  public HoodieRecord<T> newInstance(HoodieKey key, HoodieOperation op) {
+    return new HoodieAvroRecord<>(key, data, op);
+  }
+
+  @Override
+  public HoodieRecord<T> newInstance(HoodieKey key) {
+    return new HoodieAvroRecord<>(key, data);
+  }
+
   @Override
   public T getData() {
     if (data == null) {
       throw new IllegalStateException("Payload already deflated for record.");
     }
     return data;
   }
+
+  @Override
+  public String getRecordKey(Option<BaseKeyGenerator> keyGeneratorOpt) {
+    return getRecordKey();
+  }
+
+  @Override
+  public Comparable<?> getOrderingValue() {
+    return data.getOrderingValue();
+  }
+
+  @Override
+  public Option<IndexedRecord> toIndexedRecord(Schema schema, Properties prop) 
throws IOException {
+    return getData().getInsertValue(schema, prop);
+  }
+
+  
//////////////////////////////////////////////////////////////////////////////
+
+  //
+  // NOTE: This method duplicates those ones of the HoodieRecordPayload and 
are placed here
+  //       for the duration of RFC-46 implementation, until migration off 
`HoodieRecordPayload`
+  //       is complete
+  //
+  // TODO cleanup
+
+  // NOTE: This method is assuming semantic that `preCombine` operation is 
bound to pick one or the other
+  //       object, and may not create a new one
+  @Override
+  public HoodieRecord<T> preCombine(HoodieRecord<T> previousRecord) {
+    T picked = unsafeCast(getData().preCombine(previousRecord.getData()));
+    if (picked instanceof HoodieMetadataPayload) {

Review Comment:
   https://issues.apache.org/jira/browse/HUDI-4222



-- 
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]

Reply via email to