Dileep Dominic
Dileep Dominic

Reputation: 519

Partition overwrite in hive

I have table structure like date_created , value created in hive with partition column as date_created. Data in the table as of now is

Date_created , value
Jan,            a
Jan,            b
Jan,            c

Now I need to load new data like

Date_created, value
Feb ,         a
Feb ,         b
Jan ,         z

When this data is loaded in hive , how it will be ? If this was a RDBMS table it was a simple insert. But in hive how to get it appended? Because Jan partition be overwritten with Jan,z value.

Upvotes: 2

Views: 996

Answers (1)

leftjoin
leftjoin

Reputation: 38290

INSERT OVERWRITE TABLE PARTITION (date_created) will overwrite data.

INSERT INTO TABLE PARTITION (date_created) will append data.

See docs here: https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DML#LanguageManualDML-InsertingdataintoHiveTablesfromqueries

Upvotes: 1

Related Questions