`

hadoop & hive 学习

 
阅读更多
1.启动hive
hive

2.显示所有表
show tables;

3.查看表的内容
describe t_app;

4.hive导文件到本地
hive -e "select * from t_app where apk_id < 1000000 " > /home/hadoop/armmy

or

hive -e "insert overwrite local directory '/recommend/armmy/' select * from t_app where apk_id < 1000000 "  

5.hive 导文件到hdfs上
hive -e "insert overwrite directory '/recommend/armmy/' select * from t_app where apk_id < 1000000 "  

6.启动hadoop作业
hadoop jar /home/hadoop/armmy/AlbumHadoopJob-1.0.jar com.hadoop.run.WallPaperRunMain  > /home/hadoop/armmy/album_correct

7.hdfs文件导入hive
load data inpath '/home/wyp/add.txt' into table wyp;

8.本地文件导入hive中
load data local inpath 'wyp.txt' into table wyp;

8、9请查考
http://blog.csdn.net/lifuxiangcaohui/article/details/40588929
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics