You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by "胡剑 (Jira)" <ji...@apache.org> on 2021/09/30 02:23:00 UTC

[jira] [Created] (FLINK-24406) JSONKeyValueDeserializationSchema code bug

胡剑 created FLINK-24406:
--------------------------

             Summary: JSONKeyValueDeserializationSchema code bug
                 Key: FLINK-24406
                 URL: https://issues.apache.org/jira/browse/FLINK-24406
             Project: Flink
          Issue Type: Bug
          Components: Connectors / Kafka
            Reporter: 胡剑


if record.key() or record.value() is an empty array, an exception will be thrown here, causing the entire program to hang

 

I think it should be fixed like this

 

if (record.key() != null && record.key().length > 0) {
 node.set("key", mapper.readValue(record.key(), JsonNode.class));
 }
 if (record.value() != null && record.value().length > 0) {
 node.set("value", mapper.readValue(record.value(), JsonNode.class));
 }



--
This message was sent by Atlassian Jira
(v8.3.4#803005)