Re: StateMigrationException when switching from TypeInformation.of to createTypeInformation
Posted by
Till Rohrmann on
URL: http://deprecated-apache-flink-user-mailing-list-archive.369.s1.nabble.com/StateMigrationException-when-switching-from-TypeInformation-of-to-createTypeInformation-tp21276p21307.html
Hi Elias,
could you check whether the `TypeInformation` returned by `TypeInformation.of(new TypeHint[ConfigState]() {}))` and `createTypeInformation[ConfigState]` return the same `TypeInformation` subtype? The problem is that the former goes through the Java TypeExtractor whereas the latter goes through the Scala `TypeUtils#createTypeInfo` where the resulting `TypeInformation` is created via Scala macros. It must be the case that the Scala `TypeUtils` generate a different `TypeInformation` (e.g. Java generating a GenericTypeInfo whereas Scala generates a TraversableTypeInfo).
It would also be helpful if you could share the definition of `ConfigState` in order to test it ourselves.
Cheers,
Till
During some refactoring we changed a job using managed state from:
ListStateDescriptor("config", TypeInformation.of(new TypeHint[ConfigState]() {}))
to
ListStateDescriptor("config", createTypeInformation[ConfigState])
After this change, Flink refused to start the new job from a savepoint or checkpoint, raising StateMigrationException instead.
Why is Flink raising this error? Both TypeInformation.of and createTypeInformation return TypeInformation[ConfigState], so why does it think the state type has changed?