Flink still use PojoSerializer for the class while only using Kryo for the UUID 
field.

Best,
Zhanghao Chen
________________________________
From: Richard Cheung <rcheungsi...@gmail.com>
Sent: Wednesday, May 14, 2025 3:21
To: user@flink.apache.org <user@flink.apache.org>
Subject: Apache Flink Serialization Question

Hi all!

I have a question about serialization of POJO data classes in Apache Flink v1.8 
(Java). Here's some context:

One of my data classes was initially not POJO compatible as it had final fields 
and no no-arg constructor. I removed the final modifiers and added a no-arg 
constructor, and confirmed that the serializer switched from KryoSerializer to 
PojoSerializer using TypeInformation and TypeSerializer to log the info.

However, one of the fields in the class is a java.util.UUID, which is not POJO 
compatible. I see a log message saying that the UUID field cannot be used as a 
POJO type. The logs also say that the UUID field will be processed as a generic 
type which means that, to my knowledge, the KryoSerializer will be used. These 
logs appear after the one indicating that the PojoSerializer is being used for 
my data class.

My question is:
Does the presence of the UUID field cause the entire class to be serialized 
with KryoSerializer or does Flink still use PojoSerializer for the class while 
only using Kryo for the UUID field?

Best regards,
Richard

Reply via email to