Reputation:
So I wanted to try custom mapper reducer queries using Hive MAP and REDUCE.
I have written and exported the custom mapper and reducer to jar file and tried adding it from Hive CLI. I am getting does "not exist" error no matter where I am copying the jar. I tried the following.
I copied the file to /usr/local/hive/lib/ , /usr/local/hive/conf/ and /tmp/ then in hdfs also I copied it to / , /user/hive/ and /user/hive/warehouse/
I tried giving the full path then I am getting URL syntax exception
hive> add jar 'hdfs://srimanthpc:9000/SpaceTravel.jar';
Illegal character in scheme name at index 0: 'hdfs://srimanthpc:9000/SpaceTravel.jar'
Query returned non-zero code: 1, cause: java.net.URISyntaxException: Illegal character in scheme name at index 0: 'hdfs://srimanthpc:9000/SpaceTravel.jar'
hive> add jar 'file:///home/anil/Desktop/SpaceTravel.jar';
Illegal character in scheme name at index 0: 'file:///home/anil/Desktop/SpaceTravel.jar'
Query returned non-zero code: 1, cause: java.net.URISyntaxException: Illegal character in scheme name at index 0: 'file:///home/anil/Desktop/SpaceTravel.jar'
If I give the path without any schema it says it does not exist. I tried add file instead of add jar also.
My hive-site.xml has hive.aux.jars.path set to /usr/local/hive/lib/. I tried changing this to file:/// hdfs://localhost:9000/ but no change :(
All the online documentation says ADD JAR|FILE filepath. but nobody is mentioning what the that path. :(
I have been stuck here since past 4 hours please help me. What am I missing?
Additional info : My .bashrc
export HIVE_HOME=/usr/local/hive
export PATH=$PATH:$HIVE_HOME/bin
export CLASSPATH=$CLASSPATH:/usr/local/Hadoop/lib/*:.
export CLASSPATH=$CLASSPATH:/usr/local/hive/lib/*:.
Upvotes: 2
Views: 13183
Reputation: 5881
remove '
from your query
hive> add jar hdfs://srimanthpc:9000/SpaceTravel.jar;
in case, master is on localhost
hive> add jar hdfs://localhost:9000/SpaceTravel.jar;
make sure SpaceTravel.jar
should be in hdfs.
by using command
hdfs dfs -ls /
Upvotes: 7