filter(func)

filter(func)

Return a new DStream by selecting only the records of the source DStream on which func returns true.
1
val union = ssc.union(rawStreams)
2
union.filter(_.contains("the")).count().foreachRDD(r =>
3
println(s"Grep count: ${r.collect().mkString}"))
4
​
Copied!
​
Last modified 1yr ago
Copy link