Description
Update Python examples of Direct Kafka word count to access the offset ranges using HasOffsetRanges and print it. For example in Scala,
var offsetRanges: Array[OffsetRange] = _ ... directKafkaDStream.foreachRDD { rdd => offsetRanges = rdd.asInstanceOf[HasOffsetRanges] } ... transformedDStream.foreachRDD { rdd => // some operation println("Processed ranges: " + offsetRanges) }
See https://spark.apache.org/docs/latest/streaming-kafka-integration.html for more info, and the master source code for more updated information on python.