0

I have a DStream[String,String] and I need to convert it to RDD[String,String]. Is there any way to do it? I need to do using Scala language.

Thanks in advance!!

Manoj Kumar Dhakad
  • 1,862
  • 1
  • 12
  • 26

1 Answers1

0

A DStream is a discretized sequence of RDDs. Take a look to the direct stream API.

Having your DStream,with the forEach function you can apply transformations for each RDD:

val yourStream: DStream[String] = //...

yourStream.forEachRDD{ rdd =>
   // your rdd transformations...
}

You can take a look to examples here

Emiliano Martinez
  • 4,073
  • 2
  • 9
  • 19