Vancior commented on code in PR #19878:
URL: https://github.com/apache/flink/pull/19878#discussion_r897938554


##########
flink-python/pyflink/fn_execution/beam/beam_operations.py:
##########
@@ -151,9 +150,19 @@ def _create_user_defined_function_operation(factory, 
transform_proto, consumers,
         input=None,
         side_inputs=None,
         output_coders=[output_coders[tag] for tag in output_tags])
+    serialized_fn = spec.serialized_fn
     name = common.NameContext(transform_proto.unique_name)
 
-    serialized_fn = spec.serialized_fn
+    if isinstance(serialized_fn, 
flink_fn_execution_pb2.UserDefinedDataStreamFunction):
+        operator_state_backend = RemoteOperatorStateBackend(
+            factory.state_handler,
+            serialized_fn.state_cache_size,
+            serialized_fn.map_state_read_cache_size,
+            serialized_fn.map_state_write_cache_size,
+        )
+    else:
+        operator_state_backend = None

Review Comment:
   Only DataStream API can use operator state, so I guess that's okay



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to