jonvex commented on code in PR #13860:
URL: https://github.com/apache/hudi/pull/13860#discussion_r2359727828


##########
hudi-common/src/main/java/org/apache/hudi/common/model/HoodieAvroIndexedRecord.java:
##########
@@ -187,7 +188,9 @@ public HoodieRecord joinWith(HoodieRecord other, Schema 
targetSchema) {
   @Override
   public HoodieRecord prependMetaFields(Schema recordSchema, Schema 
targetSchema, MetadataValues metadataValues, Properties props) {
     decodeRecord(recordSchema);
-    GenericRecord newAvroRecord = 
HoodieAvroUtils.rewriteRecordWithNewSchema(data, targetSchema);
+    GenericRecord genericRecord = (GenericRecord) data;
+    int metaFieldSize = targetSchema.getFields().size() - 
genericRecord.getSchema().getFields().size();

Review Comment:
   We are making quite a few assumptions here. Are we confident that they will 
always hold? 
   We are assuming that targetSchema is not nullable, and we are assuming that 
target schema is the same as the generic record schema besides the meta fields. 
We could do a deeper comparison, but that might be costly if we are doing this 
every record. Maybe we could validate deeper on the first record and then after 
that just do this?



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