Top N records - Data Frame


Hi All,
I want to know if one should use DENSE_RANK() function when asked to find top N records.
I’ve seen few solutions here where folks have used limit or row number to find top N. I think this may work in many cases but not in case of tie.
Would like to hear your thoughts.


Prepare for certifications on our state of the art labs which have Hadoop, Spark, Kafka, Hive and other Big Data technologies

  • Click here for signing up for our state of the art 13 node Hadoop and Spark Cluster