I have a Streaming Dataset
in Spark with a certain schema. When I want to compute a query on it I call:
StreamingQuery query = querydf
.writeStream()
.outputMode(OutputMode.Update())
.format("console")
.start();
query.awaitTermination();
In this way I can see in the console the result of the query every trigger. How can I write the result DataFrame in Mongo? For Straming Dataset
is not possible. Should I convert the streaming Dataset
into static Dataset
every trigger and then save it? How can I do it?