0

I have gone through some of the Stackoveflow question . but I was not able to do the same.

Hive doesnot support update but a workaround for that is to create partition to table.

How to update a record in Hive?

USB
  • 6,019
  • 15
  • 62
  • 93

1 Answers1

0

The update feature in Hive is planned in the next release.

As a workaround , You could try the below :

  1. Add a flag column default as I and a timestamp column
  2. consider partitions as your primary key fields (combination).
  3. whenever a new record (updated ) on this primary key combination set the flag as U.
  4. Write a custom serde class where in only U records are shown.

NOTE : There will be duplicated data , but serde should only show the latest U data corresponding to the latest timestamp in the timestamp column.

K S Nidhin
  • 2,622
  • 2
  • 22
  • 44