Using Apache Hive
Also available as:
PDF

Update data in a table

You use the UPDATE statement to modify data already stored in an Apache Hive table.

You construct an UPDATE statement using the following syntax:

UPDATE tablename SET column = value [, column = value ...] [WHERE expression];

Depending on the condition specified in the optional WHERE clause, an UPDATE statement might affect every row in a table. The expression in the WHERE clause must be an expression supported by a Hive SELECT clause. Subqueries are not allowed on the right side of the SET statement. Partition and bucket columns cannot be updated.

You must have SELECT and UPDATE privileges to use the UPDATE statement.
Create a statement that changes the values in the name column of all rows where the gpa column has the value of 1.0.
UPDATE students SET name = null WHERE gpa <= 1.0;