Hive Version used - hive-0.12.0
In Previous Blog we have seen creating and loading data into partition table.
Now we will try to update one record using INSERT statement as hive doesnt support UPDATE command. In newer version of hive, UPDATE command will be added.
We will see an example for updating Salary of employee id 19 to 50,000
INSERT INTO TABLE Unm_Parti_SCDFoldTrail PARTITION (Department = 'A') SELECT employeeid,firstname,designation, CASE WHEN employeeid=19 THEN 50000 ELSE salary END AS salary FROM Unm_Parti_SCDFoldTrail Where employeeid=19;
Using the above command your hive record get updated.