Re: how to use the method saveAsTextFile of a RDD like javaRDD

2014-08-14 Thread Gefei Li
It is interesting to save a RDD on a disk or HDFS or somethings else as a set of objects, but I think it's more useful to save it as a text file for debugging or just as an output file. If we want to reuse a RDD, text file also works, but perhaps a set of object files will bring a decrease on execu

Re: how to use the method saveAsTextFile of a RDD like javaRDD

2014-08-14 Thread Hoai-Thu Vuong
I've found a method saveAsObjectFile in RDD (or JavaRDD). I think we can save this array to file and load back to object when read these file. However, I've known the way to load back and cast RDD to specific object, need time to try. On Thu, Aug 14, 2014 at 3:48 PM, Gefei Li wrote: > Thank you

Re: how to use the method saveAsTextFile of a RDD like javaRDD

2014-08-14 Thread Gefei Li
Thank you! It works so well for me! Regards, Gefei On Thu, Aug 14, 2014 at 4:25 PM, Tathagata Das wrote: > FlatMap the JavaRDD to JavaRDD. Then it should > work. > > TD > > > On Thu, Aug 14, 2014 at 1:23 AM, Gefei Li wrote: > >> Hello, >> I wrote a class named BooleanPair: >> >> public st

Re: how to use the method saveAsTextFile of a RDD like javaRDD

2014-08-14 Thread Tathagata Das
FlatMap the JavaRDD to JavaRDD. Then it should work. TD On Thu, Aug 14, 2014 at 1:23 AM, Gefei Li wrote: > Hello, > I wrote a class named BooleanPair: > > public static class BooleanPairet implements Serializable{ > public Boolean elementBool1; > public Boolean elementBool2

how to use the method saveAsTextFile of a RDD like javaRDD

2014-08-14 Thread Gefei Li
Hello, I wrote a class named BooleanPair: public static class BooleanPairet implements Serializable{ public Boolean elementBool1; public Boolean elementBool2; BooleanPair(Boolean bool1, Boolean bool2){elementBool1 = bool1; elementBool2 = bool2;} public String to