title: Is there any better method than collect to read an RDD in spark?
body: <p>So, I want to read and RDD into an array. For that purpose, I could use the <strong>collect</strong> method. But that method is really annoying as in my case it keeps on giving kyro buffer overflow errors. If I set the kyro buffer size too much, it starts to have its own problems. On the other hand, I have noticed that if I just save the RDD into a file using the <strong>saveAsTextFile</strong> method, I get no errors. So, I was thinking, there must be some better method of reading an RDD into an array which isn't as problematic as the <strong>collect</strong> method.</p>