所以在得到这个答案Spark Streaming : Join Dstream batches into single output Folder的帮助后,我能够为我的Twitter流创建一个文件。但是,现在我看不到在此文件中保存任何推文。请在下面找到我的代码段。我做错了什么?
val ssc = new StreamingContext(sparkConf, Seconds(5))
val stream = TwitterUtils.createStream(ssc, None, filters)
val tweets = stream.map(r => r.getText)
tweets.foreachRDD{rdd =>
val sqlContext = SQLContextSingleton.getInstance(rdd.sparkContext)
import sqlContext.implicits._
val df = rdd.map(t => Record(t)).toDF()
df.save("com.databricks.spark.csv",SaveMode.Append,Map("path"->"tweetstream.csv")
}
ssc.start()
ssc.awaitTermination()
}