A Spark structured streaming process has three types of components:
- The input source is specified with the format(source: String) method on DataStreamReader. This source can be a file, a Kafka topic, a network socket, or a constant rate. Once configured with option, the call to load() returns a DataFrame.
- Operations are the classic DataFrame/Dataset transformations, such as map, filter, flatMap, and reduce. They take Dataset as input and return another transformed Dataset with the recorded transformation.
- The output sink writes the transformed data. For specifying the sink, we must first obtain DataStreamWriter by calling the writeStream method on Dataset, and then configure it. For this, we have to call the ...