takeOrdered on multiple columns in scala

apache-spark

#1

val products_dsc3 = products.map(product => ((product._5,product._1),product)).takeOrdered(10)(Ordering[Float,Int].reverse.on(product => (product._1._1,product._1._2))

is it possible like this…i mean i want to use take ordering on multiple columns


#2

Use as Ordering.Tuple2[Float, Int]