Github user tdas commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17246#discussion_r106720722
  
    --- Diff: docs/structured-streaming-kafka-integration.md ---
    @@ -373,11 +375,204 @@ The following configurations are optional:
     </tr>
     </table>
     
    +## Producing Data to Kafka
    +
    +### Writing Streaming Queries to Kafka
    +
    +<div class="codetabs">
    +<div data-lang="scala" markdown="1">
    +{% highlight scala %}
    +
    +// Write key-value data from a DataFrame to a specific Kafka topic 
specified in an option
    +val s1 = df1
    +  .selectExpr("CAST(key AS STRING)", "CAST(value AS STRING)")
    +  .writeStream
    +  .format("kafka")
    +  .option("kafka.bootstrap.servers", "host1:port1,host2:port2")
    +  .option("topic", "topic1")
    +  .start()
    +
    +// Write key-value data from a DataFrame to Kafka using a topic specified 
in the data
    +val s2 = df2
    +  .selectExpr("topic", "CAST(key AS STRING)", "CAST(value AS STRING)")
    +  .writeStream
    +  .format("kafka")
    +  .option("kafka.bootstrap.servers", "host1:port1,host2:port2")
    +  .start()
    +
    +{% endhighlight %}
    +</div>
    +<div data-lang="java" markdown="1">
    +{% highlight java %}
    +
    +// Write key-value data from a DataFrame to a specific Kafka topic 
specified in an option
    +StreamingQuery s1 = df1
    +  .selectExpr("CAST(key AS STRING)", "CAST(value AS STRING)")
    +  .writeStream()
    +  .format("kafka")
    +  .option("kafka.bootstrap.servers", "host1:port1,host2:port2")
    +  .option("topic", "topic1")
    +  .start()
    +
    +// Write key-value data from a DataFrame to Kafka using a topic specified 
in the data
    +StreamingQuery s2 = df1
    --- End diff --
    
    nit: did you mean df2? or just make all of them df?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to