spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stoney Vintson <>
Subject Re: Take last k elements from RDD?
Date Thu, 24 Oct 2013 22:59:16 GMT
I don't see common iterable trait methods such as takeRight() or last() in
the spark scala api documentation.  There are sampling and sorting methods.
 sample, sortByKey

spark scala api



Also, remember that in scala tail() will return all of the elements except
for head.

On Thu, Oct 24, 2013 at 3:23 PM, Matt Cheah <> wrote:

>  Hi everyone,
>  I see there is a take() function for RDDs, getting the first n elements.
> Is there a way to get the last n elements?
>  Thanks,
>  -Matt Cheah

View raw message