/tmp/output_1.txt第二种,在bash中直接通过hive -f命令,执行文件中一条或者多条sql语句。并用 > 输出流把执行结果输出到制定文件hive -f /tmp/exer.sql > /tmp/output_3.txtexer.sql 文_hive -e">
赞
踩
hive -e "select * from test.hour_rate2 where year='2019'" > /tmp/output_1.txt
- hive -f /tmp/exer.sql > /tmp/output_3.txt
-
- exer.sql 文件内容
- use test;
- select * from hour_rate2 where year = '2018';
- select count(*) from hour_rate2;
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。