Skip to content

Instantly share code, notes, and snippets.

@jlafall
jlafall / WordCountKafkaCouchbase.scala
Last active January 24, 2018 16:28
Apache Spark Structured Streaming word count using Kafka as the source and Couchbase and the sink
import org.apache.spark.sql.SparkSession
import org.apache.spark.sql.functions._
object WordCountKafkaCouchbase {
def main(args: Array[String]) {
// create spark session with settings
val spark = SparkSession
.builder
.appName("Word Count Test")
.config("spark.couchbase.username", "[username goes here]")