Please double check the answer to the 6th Sample Question:
6. Given the pair RDD country that contains tuples of the form ((Country, count)),
which of the following is used to get the country with the lowest number of
refugees in Scala?
Sample Questions Answer Key for this question is Option D, which is not correct. It should be Option C.
Here is the proof:
val countryData = Array(("Afghanistan", 134), ("Albania", 540),("Algeria", 210))
val country = sc.parallelize(countryData)
val lowC = country.map(x=>(x._2,x._1)).sortByKey().first
val lowD = country.map(x=>(x._2,x._1)).sortByKey(false).first