Support Questions

Find answers, ask questions, and share your expertise

Hive load data inpath issue - HDP 2.5.3


Hive load data inpath is removing source folder after loading data into hive table.

Example :

1 - hadoop fs -put test_file.csv /user/demo/path/

2 - hive> load data inpath '/user/demo/path/' overwrite into table default.test_daily_load_table;

Loading data to table default.test_daily_load_table.

- This command has removed /path folder from HDFS after loading the data into Hive table .

3 - hadoop fs -put test_file_2.csv /user/demo/path/

put: `/user/demo/path/': No such file or directory: `/user/demo/path'


Expert Contributor

@Nelson KA Rajendran

Define the table using 'external' keyword which leaves the files in place, but creates the table definition in the hive metastore.

create external table test_daily_load_table ( id int, myfields string )
row format delimited fields terminated by ','
location '/user/demo/path/';

Also refer

for create table ddl.

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.