Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error loading csv data into Hive table

Tags:

r

hive

rjdbc

i have a csv file in hadoop and i have a Hive table ,now i want to laoad that csv file into this Hive table

i have used load LOAD DATA local 'path/to/csv/file' overwrite INTO TABLE tablename;

ended up with this error :

Error in .verify.JDBC.result(r, "Unable to retrieve JDBC result set for ",  : 
Unable to retrieve JDBC result set for LOAD DATA local
'path/to/csv/file' overwrite INTO TABLE tablename 
(Error while processing statement: FAILED: 
ParseException line 1:16 missing INPATH at ''path/tp csv/file'' near '<EOF>'
)

Note: i am trying this using RJDBC connection in r

like image 217
Teja Nandury Avatar asked Oct 23 '14 13:10

Teja Nandury


2 Answers

I think the command to load CSV to Hive table is ( when CSV is in HDFS).

LOAD DATA INPATH '/user/test/my.csv' INTO TABLE my_test;
like image 61
scalauser Avatar answered Oct 31 '22 00:10

scalauser


As your file is already present in the HDFS remove the keyword Local

LOAD DATA inpath 'path/to/csv/file' overwrite INTO TABLE tablename;

like image 38
vemu Avatar answered Oct 30 '22 23:10

vemu