ondra-m / ruby-spark

Ruby wrapper for Apache Spark
MIT License
227 stars 29 forks source link

[ RDD.takeOrdered ] how to get the biggest N element? maybe #max(N) or #max_by(N){key block} #18

Open xjlin0 opened 9 years ago

xjlin0 commented 9 years ago

Really appreciate your efforts of developing Ruby-Spark and it's great.

In Spark there's a handy function of takeOrdered(N) to get the top N biggest element, very similar to Ruby's #max(N) or #max_by(N){block} method. Is it possible to make RDD.max(N) or RDD.max_by(N){key from block...} take N too?

Thanks!