val lines1 = spark.readStream.format("socket").option("host", "localhost").option("port", 9999).load()
val lines2 = spark.readStream.format("socket").option("host", "localhost").option("port", 8888).load()
val words = lines3.as[String].flatMap(_.split(" "))
val wordCounts = words.groupBy("value").count()
val query = wordCounts.writeStream.outputMode("complete").format("console").start
query.awaitTermination()