For the complete documentation index, see llms.txt. This page is also available as Markdown.

count()

count()

Return a new DStream of single-element RDDs by counting the number of elements in each RDD of the source DStream.

    val union = ssc.union(rawStreams)
    union.filter(_.contains("the")).count().foreachRDD(r =>
      println(s"Grep count: ${r.collect().mkString}"))

Last updated