Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-20470

MissingNode can't be casted to ObjectNode when deserializing JSON

    XMLWordPrintableJSON

    Details

      Description

      Caused by: java.io.IOException: Failed to deserialize JSON ''.
              at
      org.apache.flink.formats.json.JsonRowDataDeserializationSchema.deserialize(JsonRowDataDeserializationSchema.java:126)
      ~[flink-json-1.11.2.jar:1.11.2]
              at
      org.apache.flink.formats.json.JsonRowDataDeserializationSchema.deserialize(JsonRowDataDeserializationSchema.java:76)
      ~[flink-json-1.11.2.jar:1.11.2]
              at
      org.apache.flink.api.common.serialization.DeserializationSchema.deserialize(DeserializationSchema.java:81)
      ~[flink-dist_2.11-1.11.2.jar:1.11.2]
              at
      org.apache.flink.streaming.connectors.kafka.internals.KafkaDeserializationSchemaWrapper.deserialize(KafkaDeserializationSchemaWrapper.java:56)
      ~[flink-sql-connector-kafka_2.11-1.11.2.jar:1.11.2]
              at
      org.apache.flink.streaming.connectors.kafka.internal.KafkaFetcher.partitionConsumerRecordsHandler(KafkaFetcher.java:181)
      ~[flink-sql-connector-kafka_2.11-1.11.2.jar:1.11.2]
              at
      org.apache.flink.streaming.connectors.kafka.internal.KafkaFetcher.runFetchLoop(KafkaFetcher.java:141)
      ~[flink-sql-connector-kafka_2.11-1.11.2.jar:1.11.2]
              at
      org.apache.flink.streaming.connectors.kafka.FlinkKafkaConsumerBase.run(FlinkKafkaConsumerBase.java:755)
      ~[flink-sql-connector-kafka_2.11-1.11.2.jar:1.11.2]
              at
      org.apache.flink.streaming.api.operators.StreamSource.run(StreamSource.java:100)
      ~[flink-dist_2.11-1.11.2.jar:1.11.2]
              at
      org.apache.flink.streaming.api.operators.StreamSource.run(StreamSource.java:63)
      ~[flink-dist_2.11-1.11.2.jar:1.11.2]
              at
      org.apache.flink.streaming.runtime.tasks.SourceStreamTask$LegacySourceFunctionThread.run(SourceStreamTask.java:213)
      ~[flink-dist_2.11-1.11.2.jar:1.11.2]
      Caused by: java.lang.ClassCastException:
      org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.MissingNode
      cannot be cast to
      org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.ObjectNode
      

      Currently, we only check jsonNode == null || jsonNode.isNull() for nullable node, I think we should also take MissingNode into account.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ZhuShang zhuxiaoshang
                Reporter:
                jark Jark Wu
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: