I want to write Structure Streaming Data into Cassandra using Pyspark API.
My data flow is like below:
Nifi -> Kafka -> Spark Structure Streaming -> Cassandra
I have tried below way:
query = df.writeStream\
.format("org.apache.spark.sql.cassandra")\
.option("keyspace", "demo")\
.option("table", "test")\
.start()
But getting below error message: "org.apache.spark.sql.cassandra" does not support streaming write.
Also another approach I have tried: [Source - DSE 6.0 Administrator Guide]
query = df.writeStream\
.cassandraFormat("test", "demo")\
.start()
But got exception: AttributeError: 'DataStreamWriter' object has no attribute 'cassandraFormat'
Can anyone give me some idea how I can proceed further ?
Thanks in advance.