AnsweredAssumed Answered

Streaming data from Cassandra to MapR-DB

Question asked by sohan on Apr 17, 2018
Latest reply on Apr 23, 2018 by tugdual

As of now, we got the RDD which has the Cassandra data. We are trying to convert the RDD to DataFrame so that we can save the data to MapR-DB. We are getting following error while converting the RDD to DF.

 

scala> dstream.foreachRDD { rdd=>

     |  val sqlContext = SQLContext.getOrCreate(cassandraRDD.sparkContext)

     | import spark.implicits._

     | import sqlContext.implicits._

     |     val df = rdd.toDF()

     |   }

<console>:86: error: value toDF is not a member of org.apache.spark.rdd.RDD[com.datastax.spark.connector.CassandraRow]

           val df = rdd.toDF()

 

Please let us know, if you need more information. Thanks.

Outcomes