I have designed a Nifi flow to push JSON events serialized in Avro format into Kafka topic, then I am trying to consume it in Spark Structured streaming.
While Kafka part works fine, Spark Structured streaming is not able to read Avro events. It fails with below error.
[Stage 0:> (0 + 1) / 1]2019-07-19 16:56:57 ERROR Utils:91 - Aborting task
org.apache.avro.AvroRuntimeException: Malformed data. Length is negative: -62
@sapnakatti, as this is an older post, you would have a better chance of receiving a resolution by starting a new thread. This will also be an opportunity to provide details specific to your environment that could aid others in assisting you with a more accurate answer to your question. You can link this thread as a reference in your new post.
Vidya Sargur, Community Manager
Was your question answered? Make sure to mark the answer as the accepted solution. If you find a reply useful, say thanks by clicking on the thumbs up button. Learn more about the Cloudera Community:
Thank you @VidyaSargur. Will do. Except for the details like schema this is pretty much my code and issue so was wondering if the OP has found a way around. I'll start a new thread and include the details from my code.