Rafał Trójczak
03/20/2023, 2:49 PM15:05:22.357 [main] INFO o.a.f.a.java.typeutils.TypeExtractor -- Field Person#hobbies will be processed as GenericType. Please read the Flink documentation on "Data Types & Serialization" for details of the effect on performance and schema evolution.
I have the following class:
public class Person {
private String name;
private List<String> hobbies;
public Person() {
}
public Person(String name, List<String> hobbies) {
this.name = name;
this.hobbies = hobbies;
}
// getters and setters
}
and I prepared this `TypeInformation`:
TypeInformation<Person> personTypeInformation = Types.POJO(Person.class, Map.of(
"name", Types.STRING,
"hobbies", Types.LIST(Types.STRING)));
I saw a few options that don't work for me:
• @TypeInfo(PersonSerializerFactory.class) - but I can't use this approach because the Person class is in a different module.
• returns method, e.g.:
env.fromCollection(persons)
.returns(personTypeInformation)
but this doesn't seem to remove the problem.
How can I add this type information to the environment?