I struggled a lot with this issue. I tried each of the suggested solutions from various blogs. But in my case, between calling start () on a request and several requests, finally, I called the awaitTerminate () function that calls it.
Please try this way, it works great for me. Working example:
val query = df.writeStream .outputMode("append") .format("console") .start().awaitTermination();
If you write this way, it will throw an exception / error:
val query = df.writeStream .outputMode("append") .format("console") .start()
throws this exception and closes your streaming driver.
source share