AnsweredAssumed Answered

Incorrect answer provided in spark-certification-study-guide.pdf.

Question asked by Lokesh on Apr 13, 2017
Latest reply on Apr 18, 2017 by gfluitt

I was looking into a question in document spark-certification-study-guide.pdf. I felt the answer key to this question is wrong. Could somebody please confirm what i think is right?

 

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?
a) val low = country.sortByKey().first
b) val low = country.sortByKey(false).first
c) val low = country.map(x=>(x._2,x._1)).sortByKey().first
d) val low = country.map(x=>(x._2,x._1)).sortByKey(false).first

 

Answer key says D is correct. I feel it should be C. I am worried i have undertood things wrong here. Please correct.

 

Regards,

Lokesh

Outcomes