RDD is collection of object And if these objects are mutable and changed then the same will reflect in RDD. For immutable objects it will not. Changing the mutable objects that are in the RDD is not right practise.
The RDD is immutable in the sense that any transformation on the RDD will result in new RDD object. On Tue, Dec 29, 2015 at 2:50 PM, Mark Hamstra <m...@clearstorydata.com> wrote: > You can, but you shouldn't. Using backdoors to mutate the data in an RDD > is a good way to produce confusing and inconsistent results when, e.g., an > RDD's lineage needs to be recomputed or a Task is resubmitted on fetch > failure. > > On Tue, Dec 29, 2015 at 11:24 AM, ai he <heai0...@gmail.com> wrote: > >> Same thing. >> >> Say, your underlying structure is like Array(ArrayBuffer(1, 2), >> ArrayBuffer(3, 4)). >> >> Then you can add/remove data in ArrayBuffers and then the change will >> be reflected in the rdd. >> >> >> >> On Tue, Dec 29, 2015 at 11:19 AM, salexln <sale...@gmail.com> wrote: >> > I see, so in order the RDD to be completely immutable, its content >> should be >> > immutable as well. >> > >> > And if the content is not immutable, we can change its content, but >> cannot >> > add / remove data? >> > >> > >> > >> > >> > -- >> > View this message in context: >> http://apache-spark-developers-list.1001551.n3.nabble.com/RDD-Vector-Immutability-issue-tp15827p15841.html >> > Sent from the Apache Spark Developers List mailing list archive at >> Nabble.com. >> > >> > --------------------------------------------------------------------- >> > To unsubscribe, e-mail: dev-unsubscr...@spark.apache.org >> > For additional commands, e-mail: dev-h...@spark.apache.org >> > >> >> >> >> -- >> Best >> Ai >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: dev-unsubscr...@spark.apache.org >> For additional commands, e-mail: dev-h...@spark.apache.org >> >> >