I am not able to use the kafka library in the databricks notebook.
getting the error
ImportError: No module named 'kafka'
from kafka import KafkaProducer
def send_to_kafka(rows):
producer = KafkaProducer(bootstrap_servers = "localhost:9092")
for row in rows:
producer.send('topic', str(row.asDict()))
producer.flush()
df.foreachPartition(send_to_kafka)
databricks cluster info
spark version - 2.4.3
scala version - 2.11
Help me. Thanks in advance.