Hi, you may use the option "pipeline.serialization-config" [1] to register type 
info for any custom type, which is available since Flink 1.19.

[1] 
https://nightlies.apache.org/flink/flink-docs-master/docs/deployment/config/#pipeline-serialization-config

Best,
Zhanghao Chen
________________________________
From: Sachin Mittal <sjmit...@gmail.com>
Sent: Wednesday, February 12, 2025 20:20
To: user <user@flink.apache.org>
Subject: How to register pojo type information for third party pojo classes

Hi,
I have a Pojo class provided by some library.
Say A.class

I can create a type info factory of the same like:


public class ATypeInfoFactory extends TypeInfoFactory<A> {
  @Override
  public TypeInformation<A> createTypeInfo(
      Type t, Map<String, TypeInformation<?>> genericParameters) {
    Map<String, TypeInformation<?>> fields =
        new HashMap<>() {
          {
            ...
          }
        };
    return Types.POJO(A.class, fields);
  }
}

Now I want to register this type information whenever A class's object is 
serialized or de-serialized in Flink state.

How can I register this to the StreamExecutionEnvironment.

Thanks
Sachin



Reply via email to