You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2022/10/25 14:39:28 UTC

[GitHub] [hudi] xushiyan commented on a diff in pull request #7024: [HUDI-4959] Fixing Avro's `Utf8` serialization in Kryo

xushiyan commented on code in PR #7024:
URL: https://github.com/apache/hudi/pull/7024#discussion_r1004574193


##########
hudi-common/src/test/java/org/apache/hudi/common/util/TestSerializationUtils.java:
##########
@@ -52,12 +58,33 @@ public void testSerDeser() throws IOException {
     verifyObject(new LinkedList<>(Arrays.asList(2, 3, 5)));
   }
 
+  @Test
+  public void testAvroUtf8SerDe() throws IOException {
+    byte[] firstBytes = SerializationUtils.serialize(new Utf8("test"));
+    // 4 byte string + 3 bytes length (Kryo uses variable-length encoding)
+    assertEquals(firstBytes.length, 7);

Review Comment:
   /nit expected value goes first



-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org