EternallyCurious
EternallyCurious

Reputation: 2415

Loading files into hive through JDBC

I'm getting this error when trying to load a file into Hive through its JDBC driver. The Hive instance is running on a vm. The file loads perfectly fine when I load it through hive commandline. The file is located on the same instance as Hive. I hope jdbc supports the load command.

java.sql.SQLException: Query returned non-zero code: 10, cause: FAILED: Error in semantic analysis: Line 1:23 Invalid path ''/home/cloudera/Desktop/test.csv'': No files matching path file:/home/cloudera/Desktop/test.csv at org.apache.hadoop.hive.jdbc.HiveStatement.executeQuery(HiveStatement.java:189) at Main.main(Main.java:55)

Upvotes: 2

Views: 1103

Answers (1)

Suresh
Suresh

Reputation: 186

Since hive in-turn runs in a map/reduce environment, user need to provide hdfs path for the csv file (not local path) when using hive jdbc. While running using hive cli, it takes local path as it takes care of uploading files to hdfs to load into table.

Upvotes: 1

Related Questions