It doesn't guarantee that. E.g., scala> sc.parallelize(Seq(1.0, 2.0, 3.0, 4.0), 2).filter(_ > 2.0).zipWithUniqueId().collect().foreach(println)
(3.0,1) (4.0,3) It only guarantees "unique". Best Regards, Shixiong Zhu 2015-12-13 10:18 GMT-08:00 Sourav Mazumder <sourav.mazumde...@gmail.com>: > Hi All, > > I'm trying to use zipWithUniqieId() function of RDD using transform > function of dStream. It does generate unique id always starting from 0 and > in sequence. > > However, not sure whether this is a reliable behavior which is always > guaranteed to generate sequence number starting form 0. > > Can anyone confirm ? > > Regards, > Sourav >