def sparkWithAlgebird()

in src/main/scala/com/spotify/bdrc/pipeline/MaxItemPerUser.scala [81:91]


  def sparkWithAlgebird(input: RDD[Rating]): RDD[Rating] = {
    import com.twitter.algebird.Aggregator.maxBy
    import com.twitter.algebird.spark._
    input
      .keyBy(_.user)
      .algebird
      // Aggregate per key into a single `Rating` based on `Double` value via `_.score`. Explicit
      // type due to type inference limitation.
      .aggregateByKey(maxBy { x: Rating => x.score })
      .values
  }