I donโt know about a built-in function or UDF that will simulate this behavior, but if you use HIVE 0.13 , you can use the row_number() function row_number() round way to get the desired result.
select pk, col_1, col_2, ... , col_n from ( select pk, col_1, col_2, ... , col_n, row_number() OVER (ORDER by pk) as rank from some_database.some_table ) x where rank between 31 and 50
gobrewers14
source share