Question about null fields
pedroteixeira opened this issue · comments
Any particular reason why "Null fields are not supported"?
Any plans to support them?
Thanks,
Pedro
It's a limitation of Flink when using tuples, see: https://nightlies.apache.org/flink/flink-docs-release-1.17/docs/dev/datastream/fault-tolerance/serialization/types_serialization/#flinks-typeinformation-class
Hi, I came across this same issue... I understand this is a Flink limitation when using tuples, but:
- How can we deal with nullable fields in Kotlin data classes? I think most non-trivial use cases would require some way to do so
- Could TypeInfo for data classes be somehow modeled as a subclass of
PojoTypeInfo
instead ofTupleTypeInfoBase
? Flink documentation doesn't state POJOs have this same not-null limitation as Tuples do
PS: sorry to bring this up again, but seemed better to open a new issue
You can model nullable values as a distinct type that isn't nilable.
Right, I thought that too. I tried using Java's Optional
, but this can only be serialized via Flink Kryo fallback, which is not desirable. Do you see a better approach?