Reputation: 37
How can I REPLACE an existing hive table data with new set of data? NOTE: I don't want to drop the entire table and create new one. Rather i am looking for a method through which i can just replace the data from the table.
Upvotes: 0
Views: 648
Reputation: 3619
Use OVERWRITE
while loading or inserting data.
LOAD DATA INPATH '/PATH/TO/DATA' OVERWRITE INTO TABLE MYTABLE
If the OVERWRITE keyword is used then the contents of the target table will be deleted and replaced by the files referred to by filepath; otherwise the files referred by filepath will be added to the table.
Upvotes: 2