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


##########
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:
   The ckech might not be necessary because `HoodieAvroUtils.avroToBytes` never 
includes the magic code?



##########
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:
   The ckeck might not be necessary because `HoodieAvroUtils.avroToBytes` never 
includes the magic code?



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