Reputation: 13
I am new to hadoop and in the learning phase. When I am trying to execute the below statement in hive, the empl.txt
is being moved to trash folder.
load data inpath '/user/trnkimz/empl.txt' into table empl;
Also, the data is not getting stored in the empl table.
In my empl table, I am having the below columns: e-id int
and e_name String
.
In my empl.txt
file, I am having the below data in it:
1,john
2,smith
3,alex
Kindly suggest, that why I am not able to load data from HDFS to hive table. Thanks in advance.
Upvotes: 0
Views: 609
Reputation: 539
we can load data to a hive table in 2 ways
1) load table with data with local data
hive> LOAD DATA LOCAL INPATH '' OVERWRITE INTO TABLE ;
2) load table with data with HDFS data
hive> LOAD DATA INPATH '' OVERWRITE INTO TABLE ;
Upvotes: 0
Reputation: 111
First you have to check whether you are having your input file in local or hdfs .
If it is in local means you have to use LOAD DATA LOCAL INPATH '/home/username/inputfile' into table TABLENAME (this is equal to copyFromLocal)
If it is in HDFS means you have to use LOAD DATA INPATH '/inputfile' into table TABLENAME (this is equal to mv command in hdfs)
Upvotes: 1