GitHub user zhangxinyu1 opened a pull request: https://github.com/apache/spark/pull/15483
Add KafkaForeachWriter in external kafka-0.8.0 for structured streaming module ## What changes were proposed in this pull request? I propose a `KafkaForeachWriter.scala` in external kafka-0.8.0. It's useful for someone who requires to write results to kafka in structured streaming module. It can be used with `ForeachSink`, and the usage is as below: `val query = input.writeStream` `.outputMode("append")` `.foreach(new KafkaForeachWriter[Row](producerProps, topics, input.schema)` `.start()` ## How was this patch tested? Unit test in `KafkaForeachWriterSuite.scala` You can merge this pull request into a Git repository by running: $ git pull https://github.com/zhangxinyu1/spark feature-kafkaForeachWriter-in-external-kafka-0-8-for-structured-streaming Alternatively you can review and apply these changes as the patch at: https://github.com/apache/spark/pull/15483.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #15483 ---- commit 8c2022755c08828edea3ef61f35a8490d1d6af24 Author: zhangxinyu1 <342689...@qq.com> Date: 2016-10-11T09:15:09Z add KafkaForeachWriter for structured streaming. It can be used with ForeachSink commit 1ad774919598aca5cf126c2c6e19fa618eaaa5d1 Author: zhangxinyu1 <342689...@qq.com> Date: 2016-10-14T10:29:33Z Add KafkaForeachWriter to write result to kafka in structured streaming It can be used with ForeachSink ---- --- 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