July 2017
Intermediate to advanced
796 pages
18h 55m
English
Structured streaming is new in Apache Spark 2.0+ and is now in GA from Spark 2.2 release. You will see details in the next section along with examples of how to use structured streaming.
An example of how to use Kafka source stream in structured streaming is as follows:
val ds1 = spark .readStream .format("Kafka") .option("Kafka.bootstrap.servers", "host1:port1,host2:port2") .option("subscribe", "topic1") .load()ds1.selectExpr("CAST(key AS STRING)", "CAST(value AS STRING)") .as[(String, String)]
An example of how to use Kafka source instead of source stream (in case ...
Read now
Unlock full access