I'm developing a real-time streaming application that polls data from a Kafka broker, and I am adapting the code that previously worked using Spark Structured Streaming by default (with micro-batching). However, I don't know how to obtain a similar behavior using continuous streaming instead of micro-batching streaming. This is the piece of code that works:
query = df.writeStream \
.foreachBatch(foreach_batch_func) \
.start()
This is what I tried so far with continuous streaming:
query = df \
.writeStream \
.foreach(example_func) \
.trigger(continuous = '1 second') \
.start()
And the app pops out the following error:
Continuous execution does not support task retry at
org.apache.spark.sql.execution.streaming.continuous.ContinuousDataSourceRDD.compute(ContinuousDataSourceRDD.scala:76)
I'm using Spark (pyspark) 3.0.1 w/Scala 2.12, Kafka 2.6.0
and I'm adding jar org.apache.spark:spark-sql-kafka-0-10_2.12:3.0.1 when I submit the app.