安装教程:
https://cwiki.apache.org/confluence/display/Hive/GettingStarted
遇到的坑:
1.hive sql运行失败:
Caused by: org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.AccessControlException): Permission denied: user=anonymous, access=EXECUTE, inode="/tmp/hadoop-yarn/staging/anonymous/.staging":hadoop:supergroup:drwxrwx---
hdfs dfs -chmod -R 777 /tmp
2.入表数据时分隔符为”\t”,查询时数据全为null
解决:
创建表 指定分隔符
create table channel_mt_pv(channel_id string,sum int,minutes int)row format delimited fields terminated by '\t';
3.打成jar包的时候,选择把依赖包和程序分开的情况下出现此问题
java.lang.ClassNotFoundException: org.apache.hive.jdbc.HiveDriver
解决:
MANIFEST.MF里面的Class-Path包的路径必须和依赖包存放的实际位置相同,通常依赖包实际位置应该和程序jar包在相同目录
另外一种解决办法:
把依赖包和程序一起打包