tsreaper commented on a change in pull request #16699:
URL: https://github.com/apache/flink/pull/16699#discussion_r684878442



##########
File path: 
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/typeutils/LinkedListSerializer.java
##########
@@ -110,17 +124,40 @@ public int getLength() {
     @Override
     public void serialize(LinkedList<T> list, DataOutputView target) throws 
IOException {
         target.writeInt(list.size());
+        if (hasNullMask) {
+            MaskUtils.writeMask(getNullMask(list), target);
+        }
         for (T element : list) {
-            elementSerializer.serialize(element, target);
+            if (element != null) {
+                elementSerializer.serialize(element, target);
+            }
         }
     }
 
+    private boolean[] getNullMask(LinkedList<T> list) {
+        boolean[] mask = new boolean[list.size()];

Review comment:
       I suppose by "reusing" you're meant to not creating a boolean array 
every time and change its size when the length of list grows.




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