Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deleting rows from Hive external table

Tags:

csv

hive

I have a Hive external table created from a list of CSV files.

If I perform a Hive delete on a table row (or a number of rows), will the corresponding CSV record/s will be deleted as well?

like image 748
oikonomiyaki Avatar asked Dec 05 '25 21:12

oikonomiyaki


1 Answers

As far as I know you can't quite delete a row in Hive -- Hive's not a database, it's a scripting language for Map Reduce. However you could do something like

INSERT OVERWRITE INTO TABLE mytable
SELECT * from mytable 
where rowid <> 1;

In which case yes, the CSV will be updated. Also see the answers to this question How to delete and update a record in Hive

like image 81
maxymoo Avatar answered Dec 08 '25 16:12

maxymoo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!