ITeye博客

hadoop & hive 学习

blgaici1 · 2014-12-03 10:49 · 开源软件 · Markdown

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

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。