Does anyone know if it's possible to bootstrap the...
# pyflink
a
Does anyone know if it's possible to bootstrap the state of a pyflink KeyedCoProcessFunction using the java State Processor API? I've tried a couple of approaches without any success.
d
@Andreas Bube I think this should be feasible. The structure of Python state is as following: • key type: the actual key type • value type: binary array, see https://github.com/apache/flink/blob/c3bf06141bcbdeaccc14c06757f8e8fe453de111/flin[…]treaming/api/runners/python/beam/state/BeamKeyedStateStore.java for more details. • state name: python-state-XXX, where XXX is the actual state name defined in Python job, see https://github.com/apache/flink/blob/c3bf06141bcbdeaccc14c06757f8e8fe453de111/flin[…]treaming/api/runners/python/beam/state/BeamKeyedStateStore.java for more details.
a
Thanks for the insights, @Dian Fu. I'll try to use those types and state uids. At first I had used the original uids that I defined for the python operation, but those resolved to
ExternalPythonKeyedCoProcessOperator
and
ExternalPythonKeyedProcessOperator
operators and not my python functions.
d
@Andreas Bube Not quite get your point. AFAIK, uid is for operators and so it's expected to resolve to
ExternalPythonKeyedCoProcessOperator
and
ExternalPythonKeyedProcessOperator
operators. The Python functions are wrapped inside the operators.
a
I misunderstood your message. I mistakenly thought that you ment the uids of the flink operators got a prefix. Now I've reread your message and I think I understand. The problem I initially faced was that they key type of the operators did not match the key types of the pyflink operators. They got wrapped in a
Row
it seems. However, when I seemingly "fixed" that by also wrapping my
String
keys in
Row
objects, then I still didn't get any state in my flink operators. However, your insights about the state names could very well explain that. I'll report back once I've tried it out. Thanks
👌 1