Difference between `load data inpath ` and `location` in hive?

At my firm, I see these two commands used frequently, and I’d like to be aware of the differences, because their functionality seems the same to me:

1

create table <mytable> 
(name string,
number double);

load data inpath '/directory-path/file.csv' into <mytable>; 

2

create table <mytable>
(name string,
number double);

location '/directory-path/file.csv';

They both copy the data from the directory on HDFS into the directory for the table on HIVE. Are there differences that one should be aware of when using these? Thank you.

Leave a Comment