Technically Dstream
is sequence of RDDs
, you won't convert Dstream
to Datframe
instead you will convert each RDD
to Dataframe/Dataset
as below(Scala code please convert it in Java for your case):
stream.foreachRDD { rdd =>
val dataFrame = rdd.map {case (key, value) => Row(key, value)}.toDF()
}