In Hive, "loads local inpath data", overwrites existing data, or adds?

I hope to start importing into Hive on cron and was hoping to just use

"loading local inpath '/ tmp / data / x' into table X" into the table will suffice.

Will subsequent commands overwrite what is already in the table? or add?

+4
source share
2 answers

This site http://wiki.apache.org/hadoop/Hive/LanguageManual is your friend when working with Hive. :)

Hive data loading page, http://wiki.apache.org/hadoop/Hive/LanguageManual/DML This page indicates that

if the OVERWRITE keyword is used, then the contents of the target table (or partition) will be deleted and replaced with files referenced by the File Path. Otherwise, the specified files along the path to the file will be added to the table. Please note that if the target table (or partition) already has a file whose name collides with any of the file names contained in the file path, then the existing file will be replaced with the new file.

In your case, you are not using the OVERWRITE keyword, so the files will be added to the table. (If they are not the same files, then they are overwritten)

+6
source

If the OVERWRITE keyword is used, the contents of the target table (or partition) will be deleted and replaced with the files specified by filepath; otherwise, files related to the file path will be added to the table.

0
source

Source: https://habr.com/ru/post/1346638/


All Articles