Queries with streaming sources must be executed with writeStream.start();

前端 未结 5 2011
悲&欢浪女
悲&欢浪女 2020-12-09 16:05

I\'m trying to read the messages from kafka (version 10) in spark and trying to print it.

     import spark.implicits._

         val spark = SparkSession
           


        
5条回答
  •  [愿得一人]
    2020-12-09 17:10

    I was able to resolves this issue by following code. In my scenario, I had multiple intermediate Dataframes, which were basically the transformations made on the inputDF.

     val query = joinedDF
          .writeStream
          .format("console")
          .option("truncate", "false")
          .outputMode(OutputMode.Complete())
          .start()
          .awaitTermination()
    

    joinedDF is the result of the last transformation performed.

提交回复
热议问题