Dundre32

Untitled

May 1st, 2020
397
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. //Group elements by key, convert the iterable to list, then sort them in descending order, take the first 200 element
  3. //Sort the result RDD by key
  4. val sortedRdd = calcChiSquares.groupByKey().map{case(k,v) => (k ,
  5.                                                               v.toList.sortWith(_.split(":")(1).toDouble > _.split(":")(1).toDouble)
  6.                                                               .take(200).mkString(" "))}.sortByKey()
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×