gyfora commented on code in PR #23490:
URL: https://github.com/apache/flink/pull/23490#discussion_r1383628349


##########
flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoSerializer.java:
##########
@@ -473,25 +519,41 @@ public T deserialize(T reuse, DataInputView source) 
throws IOException {
             }
         }
 
-        if ((flags & NO_SUBCLASS) != 0) {
+        if (isRecord) {
             try {
+                JavaRecordBuilderFactory<T>.JavaRecordBuilder builder = 
recordHelper.newBuilder();
                 for (int i = 0; i < numFields; i++) {
                     boolean isNull = source.readBoolean();
 
                     if (fields[i] != null) {
                         if (isNull) {
-                            fields[i].set(reuse, null);
+                            builder.setField(i, null);
                         } else {
-                            Object field;
+                            Object reuseField = reuse == null ? null : 
fields[i].get(reuse);

Review Comment:
   I prefer not to introduce consumers etc, the benefit is very limited



-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to