gaborgsomogyi commented on a change in pull request #23791: 
[SPARK-20597][SQL][SS][WIP] KafkaSourceProvider falls back on path as synonym 
for topic
URL: https://github.com/apache/spark/pull/23791#discussion_r261522887
 
 

 ##########
 File path: docs/structured-streaming-kafka-integration.md
 ##########
 @@ -539,35 +578,43 @@ ds = df \
 <div data-lang="scala" markdown="1">
 {% highlight scala %}
 
-// Write key-value data from a DataFrame to a specific Kafka topic specified 
in an option
+// Write key-value data from a DataFrame to Kafka using the topic specified in 
the topic option
 df.selectExpr("CAST(key AS STRING)", "CAST(value AS STRING)")
   .write
   .format("kafka")
   .option("kafka.bootstrap.servers", "host1:port1,host2:port2")
   .option("topic", "topic1")
   .save()
 
-// Write key-value data from a DataFrame to Kafka using a topic specified in 
the data
+// Write key-value data from a DataFrame to Kafka using the topic specified in 
the data
 df.selectExpr("topic", "CAST(key AS STRING)", "CAST(value AS STRING)")
   .write
   .format("kafka")
   .option("kafka.bootstrap.servers", "host1:port1,host2:port2")
   .save()
 
+// Write key-value data from a DataFrame to Kafka using the topic specified in 
the path option
+df.selectExpr("CAST(key AS STRING)", "CAST(value AS STRING)")
+  .write
+  .format("kafka")
+  .option("kafka.bootstrap.servers", "host1:port1,host2:port2")
+  .option("topic", "topic1")
+  .save()
 
 Review comment:
   The java example in the java tab.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to