value save is not a memebr of org.apache.spark.sql.DataFrame

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

value save is not a memebr of org.apache.spark.sql.DataFrame

usmanyounas135
This post has NOT been accepted by the mailing list yet.
I am getting the error that value save is not a memebr of org.apache.spark.sql.DataFrame

Here is the code

  val filters = args.takeRight(args.length - 4)
    val sparkConf = new SparkConf().setMaster("local[2]").setAppName("TwitterSentimentAnalysis")
    val sc = new SparkContext(sparkConf)
    val ssc = new StreamingContext(sc, Seconds(30))
    val stream = TwitterUtils.createStream(ssc, None, filters)
   
   val sentiments=stream.map(status=> findTweetSentiment(status.getText().toLowerCase()))
 
      sentiments.foreachRDD{rdd =>    
        val sqlContext = SQLContextSingleton.getInstance(rdd.sparkContext)
        import sqlContext.implicits._
        val df = rdd.map(sentiment=>(sentiment, a)).toDF()
        df.save("com.databricks.spark.csv", SaveMode.Append,Map("C:/Projects/MyProje/src"->"tweetstream.csv"))