hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sarath <sarathchandra.jos...@algofusiontech.com>
Subject Problem loading a CSV file
Date Fri, 28 Sep 2012 05:57:31 GMT
Hi,

I have created a new table using reference to a file on HDFS -
/create external table table1 (field1 STRING, field2 STRING, field3 
STRING, field3 STRING, field4 STRING, field5 FLOAT, field6 FLOAT, field7 
FLOAT, field8 STRING, field9 STRING) row format delimited fields 
terminated by ',' location '/user/hduser/dumps/table_dump.csv';/

The table got created successfully. But when I try retrieving rows from 
this table, it returns me nothing.
/hive> select * from table1;
OK
Time taken: 0.156 seconds/

I also tried creating the table first and then loading the HDFS file 
data into it -
/hive> create table table1 (field1 STRING, field2 STRING, field3 STRING, 
field3 STRING, field4 STRING, field5 FLOAT, field6 FLOAT, field7 FLOAT, 
field8 STRING, field9 STRING) row format delimited fields terminated by ',';
OK
Time taken: 0.088 seconds/

But when I try to load data into this table I'm getting below error -
/hive> load data inpath '/user/hduser/dumps/table_dump.csv' overwrite 
into table table1;
FAILED: Error in semantic analysis: Line 1:17 Invalid path 
''/user/hduser/dumps/table_dump.csv'': No files matching path 
hdfs://master:54310/user/hduser/dumps/table_dump.csv/

What is going wrong? Is there a different way to load a CSV file using hive?

Regards,
Sarath.

Mime
View raw message