Feroze Daud created FLINK-31879:
-----------------------------------

             Summary: org.apache.avro.util.Utf8 cannot be serialized with avro 
when used in state 
                 Key: FLINK-31879
                 URL: https://issues.apache.org/jira/browse/FLINK-31879
             Project: Flink
          Issue Type: Bug
          Components: API / Type Serialization System
            Reporter: Feroze Daud


Scenario:

Write a flink app that reads avro messages from a kafka topic.

The avro pojos are generated with _org.apache.avro.util.Utf8_ type instead of 
_java.lang.String_

When this happens, Flink logs an error message as follows:
{noformat}
Class class org.apache.avro.util.Utf8 cannot be used as a POJO type because not 
all fields are valid POJO fields, and must be processed as GenericType. Please 
read the Flink documentation on "Data Types & Serialization" for details of the 
effect on performance. {noformat}
 

This is problematic because `Utf8` is designed to be a fast 
serialized/deserialized type for Avro. But since it is not inheriting from 
SpecificRecordBase, it seems as if it gets handled by Kryo serializer.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to