wuchong commented on a change in pull request #11180: [FLINK-16220][json] Fix 
JsonRowSerializationSchema cast exception due…
URL: https://github.com/apache/flink/pull/11180#discussion_r393636044
 
 

 ##########
 File path: 
flink-formats/flink-json/src/main/java/org/apache/flink/formats/json/JsonRowSerializationSchema.java
 ##########
 @@ -360,7 +360,8 @@ private SerializationRuntimeConverter assembleRowConverter(
                return (mapper, reuse, object) -> {
                        ObjectNode node;
 
-                       if (reuse == null) {
+                       // reuse could be a NullNode if last record is null.
+                       if (!(reuse instanceof ObjectNode)) {
 
 Review comment:
   Have you considered to use `if (reuse == null || reuse.isNull())` which 
might be more straightforward? 

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


With regards,
Apache Git Services

Reply via email to