JingsongLi commented on a change in pull request #16699:
URL: https://github.com/apache/flink/pull/16699#discussion_r686606880
##########
File path:
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/typeutils/LinkedListSerializer.java
##########
@@ -110,17 +122,42 @@ 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) {
+ if (reuseMask == null || reuseMask.length != list.size()) {
Review comment:
`reuseMask.length < list.size()`
We can introduce a `void writeMask(boolean[] mask, int length,
DataOutputView target)` to `MaskUtils`.
--
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]