How can I generate row numbers for an existing table while running a select query?
For example:
select row_number(), * from emp;
I am using hive 0.13. I can't access external jars or udfs in my environment. The underlying files are in parquet format.
Thanks in advance!
ROW_NUMBER()
is a windowing function so it needs to be used in conjunction with anOVER
clause. Just don't specify anyPARTITION
.row_number() can be used to find for example, recent visit of a user on your site.