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



##########
File path: flink-python/pyflink/fn_execution/coder_impl_slow.py
##########
@@ -606,7 +607,31 @@ def _decode_one_value_from_stream(self, in_stream: 
InputStream):
         return value
 
     def __repr__(self) -> str:
-        return 'PickledBytesCoderImpl[%s]' % str(self.field_coder)
+        return 'CloudPickleCoderImpl[%s]' % str(self.field_coder)
+
+
+class PickleCoderImpl(FieldCoderImpl):
+    """
+    A coder used with pickle for all kinds of python object.
+    """
+
+    def __init__(self):
+        self.field_coder = BinaryCoderImpl()
+
+    def encode_to_stream(self, value, out_stream):
+        coded_data = pickle.dumps(value)
+        self.field_coder.encode_to_stream(coded_data, out_stream)
+
+    def decode_from_stream(self, in_stream, length=0):
+        return self._decode_one_value_from_stream(in_stream)
+
+    def _decode_one_value_from_stream(self, in_stream: InputStream):

Review comment:
       It seems not necessary to introduce such a method

##########
File path: 
flink-python/pyflink/fn_execution/datastream/window/window_operator.py
##########
@@ -324,11 +323,12 @@ def open(self, runtime_context: RuntimeContext, 
internal_timer_service: Internal
             # TODO: the type info is just a placeholder currently.
             # it should be the real type serializer after supporting the 
user-defined state type
             # serializer
-            merging_sets_state_descriptor = ListStateDescriptor(
-                "merging-window-set", Types.PICKLED_BYTE_ARRAY())
+            # merging_sets_state_descriptor = ListStateDescriptor(

Review comment:
       could just remove the code




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