Page 1 of 1

duplicates in hive table

Posted: Wed Jun 10, 2020 8:14 pm
by forum_admin
How to check duplicates in hive table used on one or two columns?

e.g. table1 and check duplicates for col1

Re: duplicates in hive table

Posted: Wed Jun 10, 2020 8:16 pm
by ram123
I tried it in HWT 2.6 and it is working.

Code: Select all

create table table2 as
Select A.* from
(select *,
row_Number() over (partition By col1 order by col1 desc) as row_num
from table1 )A
where row_num=1;