vamshikrishnakyatham commented on code in PR #13852:
URL: https://github.com/apache/hudi/pull/13852#discussion_r2328510096


##########
hudi-common/src/main/java/org/apache/hudi/avro/HoodieAvroUtils.java:
##########
@@ -161,6 +162,25 @@ public static <T extends IndexedRecord> 
ByteArrayOutputStream indexedRecordToByt
     }
   }
 
+  public static byte[] convertIndexedRecordToAvroFileFormat(IndexedRecord 
record) {
+    try {
+      byte[] bytes = HoodieAvroUtils.avroToBytes(record);
+      if (bytes.length >= 4 && bytes[0] == 0x4F && bytes[1] == 0x62 && 
bytes[2] == 0x6A && bytes[3] == 0x01) { // "Obj" magic bytes to check if its 
already in avro file format

Review Comment:
   `HoodieAvroUtils.avroToBytes` just use binary encoded bytes and not include 
magic bytes



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