Array( (ID1,Array(18159, 308703, 72636, 64544, 39244, 107937, 54477, 145272, 100079, 36318, 160992, 817, 89366, 150022, 19622, 44683, 58866, 162076, 45431, 100136)), (ID3,Array(100079, 19622, 18159, 212064, 107937, 44683, 150022, 39244, 100136, 58866, 72636, 145272, 817, 89366, 54477, 36318, 308703, 160992, 45431, 162076)), (ID2,Array(308703, 54477, 89366, 39244, 150022, 72636, 817, 58866, 44683, 19622, 160992, 107937, 100079, 100136, 145272, 64544, 18159, 45431, 36318, 162076)) )
I need to compare first 5 elements of ID1 with first five element of ID3 next first 5 elements of ID1 to ID2. Similarly next 5 elements in that order until the end of number of elements. Let me know if this helps On Sun, Jul 24, 2016 at 7:45 AM, Marco Mistroni <mmistr...@gmail.com> wrote: > Apologies I misinterpreted.... could you post two use cases? > Kr > > On 24 Jul 2016 3:41 pm, "janardhan shetty" <janardhan...@gmail.com> wrote: > >> Marco, >> >> Thanks for the response. It is indexed order and not ascending or >> descending order. >> On Jul 24, 2016 7:37 AM, "Marco Mistroni" <mmistr...@gmail.com> wrote: >> >>> Use map values to transform to an rdd where values are sorted? >>> Hth >>> >>> On 24 Jul 2016 6:23 am, "janardhan shetty" <janardhan...@gmail.com> >>> wrote: >>> >>>> I have a key,value pair rdd where value is an array of Ints. I need to >>>> maintain the order of the value in order to execute downstream >>>> modifications. How do we maintain the order of values? >>>> Ex: >>>> rdd = (id1,[5,2,3,15], >>>> Id2,[9,4,2,5]....) >>>> >>>> Followup question how do we compare between one element in rdd with all >>>> other elements ? >>>> >>>