dianfu commented on a change in pull request #13611:
URL: https://github.com/apache/flink/pull/13611#discussion_r505105967



##########
File path: flink-python/pyflink/fn_execution/beam/beam_operations_slow.py
##########
@@ -162,23 +165,36 @@ def __init__(self, name, spec, counter_factory, sampler, 
consumers):
         super(DataStreamStatelessFunctionOperation, self).__init__(name, spec, 
counter_factory,
                                                                    sampler, 
consumers)
 
-    def generate_func(self, udfs):
-        func = operation_utils.extract_data_stream_stateless_funcs(udfs=udfs)
-        return lambda it: map(func, it), []
+    def open_func(self):
+        for user_defined_func in self.user_defined_funcs:
+            runtime_context = RuntimeContext(

Review comment:
       Actually there is only one user-defined function for Python DataStream 
API. Besides, I think that the runtime context may not be shared even if there 
are multiple user-defined functions, e.g. when we support metrics, each 
function may have different metrics group. So what about keeping it as it's now 
and reconsider whether we can share them when there are actually multiple 
user-defined functions.




----------------------------------------------------------------
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.

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


Reply via email to