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

In my company, I see that these two teams are used often, and I would like to know about the differences, because their functionality seems to be 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 copy data from the HDFS directory to the directory for the HIVE table. Are there any differences that should be considered when using them? Thanks.

+4
source share
2 answers

Yes, they are used for various purposes in general.

hive. "LOCAL" , . "LOCAL" , HDFS.

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

LOCATION HDFS , , hive.metastore.warehouse.dir.

, LOCATION '/your-path/', Hive . , .

, LOCATION EXTERNAL. .

, , , LOCATION - , HDFS.

: https://cwiki.apache.org/confluence/display/Hive/GettingStarted https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL

+6

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';

. . , .

, HIVE. HDFS.

SE ,

Hive ?

+3

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


All Articles