dianfu commented on code in PR #19696:
URL: https://github.com/apache/flink/pull/19696#discussion_r870883151


##########
flink-python/pyflink/fn_execution/coder_impl_slow.py:
##########
@@ -800,6 +800,18 @@ def decode_from_stream(self, in_stream: InputStream, 
length=0):
         return CountWindow(in_stream.read_int64())
 
 
+class GlobalWindowCoderImpl(FieldCoderImpl):
+    """
+    A coder for CountWindow.
+    """
+
+    def encode_to_stream(self, value, out_stream: OutputStream):
+        out_stream.write_int64(0)
+
+    def decode_from_stream(self, in_stream: InputStream, length=0):
+        return GlobalWindowCoderImpl()

Review Comment:
   I guess you should read out the data even if it's not used at all.



##########
flink-python/pyflink/datastream/window.py:
##########
@@ -197,6 +200,31 @@ def __repr__(self):
         return "CountWindow(id={})".format(self.id)
 
 
+class GlobalWindow(Window):
+    """
+    The default window into which all data is placed (via 
org.apache.flink.streaming.api.windowing.

Review Comment:
   ```suggestion
       The default window into which all data is placed (via 
org.apache.flink.streaming.api.windowing.
   ```
   I guess it should be referring to the Python GlobalWindows instead of the 
Java ones.



##########
flink-python/pyflink/datastream/tests/test_window.py:
##########
@@ -442,3 +473,15 @@ def process(self,
 
     def clear(self, context: ProcessWindowFunction.Context) -> None:
         pass
+
+
+class GlobalWindowProcessFunction(ProcessWindowFunction[tuple, tuple, str, 
GlobalWindow]):

Review Comment:
   Where this class is used?



##########
flink-python/pyflink/datastream/window.py:
##########
@@ -197,6 +200,31 @@ def __repr__(self):
         return "CountWindow(id={})".format(self.id)
 
 
+class GlobalWindow(Window):

Review Comment:
   Need handle properly for GlobalWindow in 
https://github.com/apache/flink/blob/master/flink-python/pyflink/datastream/data_stream.py#L2135



##########
flink-python/pyflink/fn_execution/coder_impl_slow.py:
##########
@@ -800,6 +800,18 @@ def decode_from_stream(self, in_stream: InputStream, 
length=0):
         return CountWindow(in_stream.read_int64())
 
 
+class GlobalWindowCoderImpl(FieldCoderImpl):
+    """
+    A coder for CountWindow.
+    """
+
+    def encode_to_stream(self, value, out_stream: OutputStream):
+        out_stream.write_int64(0)

Review Comment:
   Why not just only one byte?



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