Data vanishing in HDFS after moving to Hive?

Hi all,

I am using Cloudera Quickstart VM 5.8.

I have loaded some flat files in HDFS .

I have created external table in hive as below :

CREATE External TABLE abc (ID int, Price double, Start_DTTM string, DEL_DT_TM string)
row format delimited fields terminated by ‘,’ stored as textfile;

load data inpath ‘/user/cloudera/CPC/QSM/QSM_MarToApr2016.csv’ into table abc;

Data loaded successfully in Hive table.

But in HDFS data is vanishing .

Please suggest

Thanks,

Syam.

If you load the data from HDFS it won’t be available to u after that load.
If you need that file instead use load data local inpath and load it from local path and you will have your file over there

Yes, that is the behavior of hive load command. If you need to have copy of the file, you might have to copy directories to stage location using hadoop fs -put and then perform hive load command.

When you creating table using external

use location while creating table and No need to load data into hive

CREATE External TABLE abc (ID int, Price double, Start_DTTM string, DEL_DT_TM string)
row format delimited fields terminated by ‘,’ stored as textfile
location ‘hdfs location’;

you can use hive load on internal tables.

2 Likes