Re: RDD[Vector] Immutability issue

2015-12-29 Thread Vivekananda Venkateswaran
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 i

Re: RDD[Vector] Immutability issue

2015-12-29 Thread Mark Hamstra
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 wrote: > Same thing. > > Sa

Re: RDD[Vector] Immutability issue

2015-12-29 Thread ai he
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 wrote: > I see, so in order the RDD to be completely immutab

Re: RDD[Vector] Immutability issue

2015-12-29 Thread salexln
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-I

Re: RDD[Vector] Immutability issue

2015-12-29 Thread ai he
Hi salexln, RDD's immutability depends on the underlying structure. I have the following example. -- scala> val m = Array.fill(2, 2)(0) m: Array[Array[Int]] = Array(Array(0, 0), Array(0

Re: RDD[Vector] Immutability issue

2015-12-28 Thread salexln
Hi Yu, thanks for the reply. I only run it in my machine (in order to debug the algorithm) . What other conditions did you have it mind? My whole code is here: https://github.com/salexln/FinalProject_FCM Best, Alex -- View this message in context: http://apache-spark-developers-list.1001551.

Re: RDD[Vector] Immutability issue

2015-12-28 Thread Yu Ishikawa
Hi salexln, Did you reproduce the same issue under any different condition? I can't reproduce this issue, since I don't know the details of the algorithm. Please let me know more detailed condition or the repository? Thanks, Yu - -- Yu Ishikawa -- View this message in context: http://apac