I made the direct stream with pyspark kafka. But I couldn't set the value of fromOffset in it. It gives me an exception ClassCastException Long cannot be assigned to int But the problem is we dont have long datatype in python version 3. So how to resolve this issue ? How can I set the fromOffset value without casting it to long in python 3? I am doing this to consume those messages which remained unread when the consumer was dead... I used approach mentioned in this link pySpark Kafka Direct Streaming update Zookeeper / Kafka Offset
Thanks