JingsongLi commented on a change in pull request #15236:
URL: https://github.com/apache/flink/pull/15236#discussion_r597419792



##########
File path: 
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/typeutils/WindowKeySerializer.java
##########
@@ -109,10 +106,9 @@ public void copy(DataInputView source, DataOutputView 
target) throws IOException
     @Override
     public int serializeToPages(WindowKey record, AbstractPagedOutputView 
target)
             throws IOException {
-        int windowSkip = checkSkipWriteForWindowPart(target);
         target.writeLong(record.getWindow());
-        int keySkip = keySerializer.serializeToPages(record.getKey(), target);
-        return windowSkip + keySkip;
+        keySerializer.serializeToPages(record.getKey(), target);
+        return 0;

Review comment:
       No, we cannot, The return value is to help better relocate the start 
offset where the data is located, and the offset we need here is the offset 
that we started to write. Consider this case:
   |---First segment----|Second Segment| 
   |--------Left 10 bytes|-----------------|
   In fact, we will write 8 bytes in the first segment and skip the next two 
bytes. At this time, its offset should also be 0




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