title: Cannot resolve Queries with streaming sources must be executed with writeStream.start() Scala
body: <p>I've trouble to resolve the following exception
  &quot;Queries with streaming sources must be executed with writeStream.start();;
  kafka&quot;</p>
  <p>My code is the following :</p>
  <pre><code>val spark = SparkSession
        .builder()
        .getOrCreate()
  
  val bootstrapServers = &quot;localhost:9092&quot;
  val topicName = &quot;name&quot;
  
  val df = spark
        .readStream
        .format(&quot;kafka&quot;)
        .option(&quot;kafka.bootstrap.servers&quot;, bootstrapServers)
        .option(&quot;subscribe&quot;, topicName)
        .option(&quot;group.id&quot;, &quot;Structured-Streaming-kpi&quot;)
        .option(&quot;failOnDataLoss&quot;, false)
        .load()
  
  df.writeStream
        .format(&quot;console&quot;)
        .start()
        .awaitTermination();
  df.show()
  </code></pre>