Section 12.143.Applying-dense_rank-using-windowing-functions

In Hive, you can use windowing functions to apply the DENSE_RANK() function, which assigns a rank to each row within a partition based on the values in one or more columns, just like the RANK() function. However, unlike the RANK() function, the DENSE_RANK() function does not skip any rank if two or more rows have the same rank.

To use the DENSE_RANK() function in Hive, you need to specify the partitioning of the rows using the PARTITION BY clause in the OVER clause. You also need to specify the ordering of the rows within each partition using the ORDER BY clause in the OVER clause.

Here’s an example of using the DENSE_RANK() function in Hive:

Share this post