I have :
table test contain :
unique_id string , file_name string , mount bigint
sample of date :
uniqu_id , file_name , mount
1 , test.txt , 15
1 , test_R_file.txt , 50
3 , test_567.txt , 30
3 , test_567_R_file.txt , 100
what I want to do :
I need query to insert overwrite the table where I need to keep for each duplicated uniqu_id one record and this record should be the ones that has (R in the file name column)
the issue :
test table is extrnal table in hive (that mean it not support update and delete operation ) so I want insert overwrite to remove duplicated records for each uniqu_id in the table (in case I have 2 records for the same unique_id only the record that has (R) in file name record should stay ) , I was think to use ranking but the idea I do not have column to order on it to knew what record should I keep and what record should I remove I just has the file_name column who should I check it in case I have 2 record has the same unique_id to knew which record should I keep and which should I remove