You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/03/01 08:53:54 UTC

[GitHub] Nimfadora commented on a change in pull request #23791: [SPARK-20597][SQL][SS][WIP] KafkaSourceProvider falls back on path as synonym for topic

Nimfadora 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_r261521069
 
 

 ##########
 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:
   @gaborgsomogyi I don't quite understand where a java version  should be specified, could you explain, please?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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