1

I am new spark, Could you please let me know how to read json data using python from kafka topic in apache spark. I tried following Code which worked for single line json but not for multiline json

*kafkaStream = KafkaUtils.createStream(ssc, k_host+':'+k_port, 'spark-streaming', {k_topic:1})
kafkaStream.pprint()
lines = kafkaStream.map(lambda row : row[1])*

Thanks.

vikrant rana
  • 4,509
  • 6
  • 32
  • 72

0 Answers0