How to use foreachRDD in legacy Spark Streaming
问题 I am getting exception while using foreachRDD for my CSV data processing. Here is my code case class Person(name: String, age: Long) val conf = new SparkConf() conf.setMaster("local[*]") conf.setAppName("CassandraExample").set("spark.driver.allowMultipleContexts", "true") val ssc = new StreamingContext(conf, Seconds(10)) val smDstream=ssc.textFileStream("file:///home/sa/testFiles") smDstream.foreachRDD((rdd,time) => { val peopleDF = rdd.map(_.split(",")).map(attributes => Person(attributes(0)