java Hive 添加文件/jar 说不存在
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/31902917/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Hive add file/jar says does not exist
提问by Srimanth Duggineni
So I wanted to try custom mapper reducer queries using Hive MAP and REDUCE.
所以我想尝试使用 Hive MAP 和 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.
我已经编写并将自定义映射器和化简器导出到 jar 文件,并尝试从 Hive CLI 添加它。无论我在哪里复制 jar,我都会收到“不存在”错误。我尝试了以下方法。
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/
我将文件复制到 /usr/local/hive/lib/ 、 /usr/local/hive/conf/ 和 /tmp/ 然后在 hdfs 中我也将它复制到 / 、 /user/hive/ 和 /user/hive/warehouse /
I tried giving the full path then I am getting URL syntax exception
我尝试提供完整路径然后我收到 URL 语法异常
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 fileinstead of add jaralso.
如果我给出没有任何架构的路径,它表示它不存在。我也尝试添加文件而不是添加 jar。
My hive-site.xml has hive.aux.jars.pathset to /usr/local/hive/lib/. I tried changing this to file:/// hdfs://localhost:9000/ but no change :(
我的 hive-site.xml 将hive.aux.jars.path设置为 /usr/local/hive/lib/。我尝试将其更改为 file:/// hdfs://localhost:9000/ 但没有更改:(
All the online documentation says ADD JAR|FILE filepath. but nobody is mentioning what the that path. :(
所有在线文档都说ADD JAR|FILE filepath。但没有人提到那条路是什么。:(
I have been stuck here since past 4 hours please help me. What am I missing?
自过去 4 小时以来,我一直被困在这里,请帮助我。我错过了什么?
Additional info : My .bashrc
附加信息:我的 .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/*:.
回答by Kishore
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.
确保SpaceTravel.jar
应该在 hdfs 中。
by using command
通过使用命令
hdfs dfs -ls /