hive:执行hql脚本

需求:

基于hive做hdfs的统计分析

涉及点:

1.基于hive 执行hql脚本:

Java代码 

  1. hive -f /home/usr/my.sql  

2.基于hive执行hql命令:

Java代码 

  1. bin/hive -e "select count(1) from tab;"  

3.安静模式执行,不打印mrjob的进度:

Java代码 

  1. hive -S -f /home/usr/my.sql  

4.执行结果存入一个txt文件里:

Java代码 

扫描二维码关注公众号,回复: 3695600 查看本文章
  1. bin/hive -S -e "select * from tab" >tab.txt  

原文参考:http://snv.iteye.com/blog/2082174

猜你喜欢

转载自blog.csdn.net/weixin_38750084/article/details/83180679
今日推荐