Re: regarding ZipWithIndex

2015-04-24 Thread Jeetendra Gangele
Anyone who can guide me how to reduce the Size from Long to Int since I dont need Long index. I am huge data and this index talking 8 bytes, if i can reduce it to 4 bytes will be great help? On 22 April 2015 at 22:46, Jeetendra Gangele wrote: > Sure thanks. if you can guide me how to do this wil

Re: regarding ZipWithIndex

2015-04-22 Thread Jeetendra Gangele
Sure thanks. if you can guide me how to do this will be great help. On 17 April 2015 at 22:05, Ted Yu wrote: > I have some assignments on hand at the moment. > > Will try to come up with sample code after I clear the assignments. > > FYI > > On Thu, Apr 16, 2015 at 2:00 PM, Jeetendra Gangele >

Re: regarding ZipWithIndex

2015-04-17 Thread Ted Yu
I have some assignments on hand at the moment. Will try to come up with sample code after I clear the assignments. FYI On Thu, Apr 16, 2015 at 2:00 PM, Jeetendra Gangele wrote: > Can you please guide me how can I extend RDD and convert into this way you > are suggesting. > > On 16 April 2015 a

Re: regarding ZipWithIndex

2015-04-17 Thread Jeetendra Gangele
Hi Ted Will you be able to guide me for any sample code for achieving this? On 17 April 2015 at 02:30, Jeetendra Gangele wrote: > Can you please guide me how can I extend RDD and convert into this way you > are suggesting. > > On 16 April 2015 at 23:46, Jeetendra Gangele wrote: > >> I type T i

Re: regarding ZipWithIndex

2015-04-16 Thread Jeetendra Gangele
Can you please guide me how can I extend RDD and convert into this way you are suggesting. On 16 April 2015 at 23:46, Jeetendra Gangele wrote: > I type T i already have Object ... I have RDD and then I am > calling ZipWithIndex on this RDD and getting RDD on this I am > running MapToPair and con

Re: regarding ZipWithIndex

2015-04-16 Thread Jeetendra Gangele
I type T i already have Object ... I have RDD and then I am calling ZipWithIndex on this RDD and getting RDD on this I am running MapToPair and converting into RDD so that i can use it later for other operation like lookup and join. On 16 April 2015 at 23:42, Ted Yu wrote: > The Long in RDD[(T,

Re: regarding ZipWithIndex

2015-04-16 Thread Ted Yu
The Long in RDD[(T, Long)] is type parameter. You can create RDD with Integer as the first type parameter. Cheers On Thu, Apr 16, 2015 at 11:07 AM, Jeetendra Gangele wrote: > Hi Ted. > This works for me. But since Long takes here 8 bytes. Can I reduce it to 4 > bytes. its just a index and I fee

Re: regarding ZipWithIndex

2015-04-16 Thread Jeetendra Gangele
Hi Ted. This works for me. But since Long takes here 8 bytes. Can I reduce it to 4 bytes. its just a index and I feel 4 bytes was more than enough.is there any method which takes Integer or similar for Index? On 13 April 2015 at 01:59, Ted Yu wrote: > bq. will return something like JavaPairRDD

Re: regarding ZipWithIndex

2015-04-13 Thread Jeetendra Gangele
How about using mapToPair and exchanging the two. Will it be efficient Below is the code , will it be efficient to convert like this. JavaPairRDD RddForMarch =matchRdd.zipWithindex.mapToPair(new PairFunction, Long, MatcherReleventData>() { @Override public Tuple2 call(Tuple2 t) throws Exception

Re: regarding ZipWithIndex

2015-04-12 Thread Ted Yu
Please also take a look at ZippedWithIndexRDDPartition which is 72 lines long. You can create your own version which extends RDD[(Long, T)] Cheers On Sun, Apr 12, 2015 at 1:29 PM, Ted Yu wrote: > bq. will return something like JavaPairRDD > > The long component of the pair fits your descriptio

Re: regarding ZipWithIndex

2015-04-12 Thread Ted Yu
bq. will return something like JavaPairRDD The long component of the pair fits your description of index. What other requirement does ZipWithIndex not provide you ? Cheers On Sun, Apr 12, 2015 at 1:16 PM, Jeetendra Gangele wrote: > Hi All I have an RDD JavaRDD and I want to convert it to > Jav