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/02/14 15:07:07 UTC

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

Nimfadora opened a new 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
 
 
   ## What changes were proposed in this pull request?
   
   **KafkaSourceProvider** supports 'topic' option that sets target Kafka topic.
   **KafkaSourceProvider** can use 'topic' column to assign rows to Kafka topics for writing.
   It is proposed to treat 'path' option in start(path: String) and save(path: String) as
   alternative to setting 'topic' option. Path would designate the target topic when 'topic'
   option is not specified and will override 'topic' column value for topic.
   
   for streaming it will look as follows:
   ```
   df.writeStream
     .format("kafka")
     .option("kafka.bootstrap.servers", "host1:port1,host2:port2")
     .start("topic")
   ```
   for batch it will look as follows:
   ```
   df.write
     .format("kafka")
     .option("kafka.bootstrap.servers", "host1:port1,host2:port2")
     .save("topic")
   ```
   
   ## How was this patch tested?
   Added and extended unit tests, local build&test
   
   ## TODO:
   
   Currently if topic in 'path' option is specified it overrides topic column and 
   is overridden by 'topic' option (if present). 
   IMHO this relation seems more straightforward than that specified in the ticket
   ('path' is the least precedence option), but this is arguable, what is your opinion?
   
   When this question will be resolved, docs should be changed in accordance with the
   final decision.

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