0

I am trying to upload json file on hadoop using json serde. I have uploaded jar lib to hadoop but getting error while running hive command

I have uploaded json serde jar file to /apps/hive/warehouse/lib path.Now, when i am tring to run this command

ADD JAR /apps/hive/warehouse/lib/json-serde-1.3-jar-with-dependencies.jar;

I got this error

H110 Unable to submit statement. Error while processing statement: /apps/hive/warehouse/lib/json-serde-1.3.7-SNAPSHOT-jar-with-dependencies.jar does not exist [ERROR_STATUS]

leftjoin
  • 36,950
  • 8
  • 57
  • 116
user4440416
  • 71
  • 1
  • 11

2 Answers2

0

Try to use URL (add file//) before filename:

ADD JAR file///apps/hive/warehouse/lib/json-serde-1.3-jar-with-dependencies.jar;

Also you should be able to add jar from a repository if your Hive is 1.2.0 and above.

leftjoin
  • 36,950
  • 8
  • 57
  • 116
  • how to add jar from repositry? and in this line of code ADD JAR file///apps/hive/warehouse/lib/json-serde-1.3-jar-with-dependencies.jar; what to write instead of file?? which file name? – user4440416 Apr 10 '19 at 18:30
  • 1
    Use `http://www.congiu.net/hive-json-serde/1.3.7/cdh5/json-serde-1.3.7-jar-with-dependencies.jar` – leftjoin Apr 10 '19 at 18:43
0

Looks like your jar is in HDFS location. Use:

add jar hdfs:///apps/hive/warehouse/lib/json-serde-1.3-jar-with-dependencies.jar;
James Jithin
  • 10,183
  • 5
  • 36
  • 51
  • running this command add jar hdfs:///apps/hive/warehouse/lib/json-serde-1.3-jar-with-dependencies.jar; getting same error H110 Unable to submit statement. Error while processing statement: /apps/hive/warehouse/lib/json-serde-1.3.7-SNAPSHOT-jar-with-dependencies.jar does not exist [ERROR_STATUS] – user4440416 Apr 10 '19 at 18:11
  • Try hadoop fs -ls /apps/hive/warehouse/lib/json-serde-1.3-jar-with-dependencies.jar and confirm if the file exists – James Jithin Apr 10 '19 at 18:13
  • after running this command i got this on kernel -rw-r--r-- 3 admin hdfs 75134 2019-04-10 09:12 /apps/hive/warehouse/lib/json-serde-1.3-jar-with-dependencies.jar – user4440416 Apr 10 '19 at 18:18
  • How are you connecting to hive? Is hive running on the same machine where you did the hadoop fs -ls? – James Jithin Apr 10 '19 at 18:40
  • Try copying the file on to the local file system such as /tmp and try load from there. Let me know if that works – James Jithin Apr 10 '19 at 19:27
  • 1
    add jar hdfs:///apps/hive/warehouse/lib/json-serde-1.3-jar-with-dependencies.jar; converting to local hdfs:///apps/hive/warehouse/lib/json-serde-1.3-jar-with-dependencies.jar Added [/tmp/6f1a54b9-65c4-4e32-8e87-25d60ef775c6_resources/json-serde-1.3-jar-with-dependencies.jar] to class path Added resources: [hdfs:///apps/hive/warehouse/lib/json-serde-1.3-jar-with-dependencies.jar] successfully added thankyou – user4440416 Apr 11 '19 at 05:20
  • Great to know @user4440416! – James Jithin Apr 11 '19 at 07:24
  • now unable to load json file on hive .. posted on another thread .. if you can help – user4440416 Apr 11 '19 at 07:54
  • @user4440416, please see the response – James Jithin Apr 11 '19 at 09:47