title: Queries with streaming sources must be executed with writeStream.start();
body: <p>I'm trying to read the messages from kafka (version 10) in spark and trying to print it.</p>
  
  <pre><code>     import spark.implicits._
  
           val spark = SparkSession
                .builder
                .appName("StructuredNetworkWordCount")
                .config("spark.master", "local")
                .getOrCreate()  
  
              val ds1 = spark.readStream.format("kafka")
                .option("kafka.bootstrap.servers", "localhost:9092")  
                .option("subscribe", "topicA")
                .load()
  
             ds1.collect.foreach(println)
             ds1.writeStream
             .format("console")
             .start()
  
             ds1.printSchema()
  </code></pre>
  
  <p>getting an error Exception in thread "main" </p>
  
  <blockquote>
    <p>org.apache.spark.sql.AnalysisException: Queries with streaming sources
    must be executed with writeStream.start();;</p>
  </blockquote>