countByValueAndWindow(windowDuration, slideDuration, numPartitions=None)¶
Return a new DStream in which each RDD contains the count of distinct elements in RDDs in a sliding window over this DStream.
width of the window; must be a multiple of this DStream’s batching interval
sliding interval of the window (i.e., the interval after which the new DStream will generate RDDs); must be a multiple of this DStream’s batching interval
- numPartitionsint, optional
number of partitions of each RDD in the new DStream.