David Lane
09/27/2023, 11:34 PMPojoTestUtils.assertSerializedAsPojoWithoutKryo
as detailed here https://nightlies.apache.org/flink/flink-docs-master/docs/dev/datastream/fault-tolerance/serialization/types_serialization/ and started fixing the problems that are reported. Most were initially list / map problems which I have fixed with @TypeInfo and TypeInfoFactory implementations. Now I have run up against a problem on an interface type similar to the following:
@JsonTypeInfo(use = NAME, include = PROPERTY, property = "conditionType")
@JsonSubTypes({
@JsonSubTypes.Type(value = NumericComparisonCondition.class, name = "NumericComparison"),
@JsonSubTypes.Type(value = StringComparisonCondition.class, name = "StringComparison"),
...
})
public interface Condition {
boolean checkMatch(Event eventContent);
List<String> validate();
}
Is there any quick way around this?
I presumed the fix would involve writing my own TypeInformation and TypeSerializer but have found no information on this in the internet. I have found references to the need to do so but no description of how or samples.
I think most of the methods to implement on TypeInformation are obvious enough apart from
@Override
public int getArity() {
return 0;
}
@Override
public int getTotalFields() {
return 0;
}
I have an idea what they mean but have no idea of how to provide them for the above class. Any tips? I would use JSON / Jackson as the basis of the Serde.
I also had the idea of just creating a TypeSerializer for the whole Rule using Jackson but run up against the same question there.Pedro H S Teixeira
09/29/2023, 4:04 PMPedro H S Teixeira
09/29/2023, 4:04 PMMap<String, Object>
property field inside a POJODavid Lane
10/02/2023, 9:54 PM