1新建shell脚本
hive> afan@ubuntu:/usr/local/hadoop$ cattest.sh
#!/bin/bash
source/home/afan/.bashrc
#HQL
hive<<EOF
select *from t_afan_test;
EOF
2执行shell脚本
afan@ubuntu:/usr/local/hadoop$ chmod u+x test.sh
afan@ubuntu:/usr/local/hadoop$ ./test.sh
Hivehistoryfile=/tmp/afan/hive_job_log_afan_201105280736_1879932739.txt
hive> select * from t_afan_test;
OK
[12,23,23,34]
[34,45,34,23,12]
Timetaken: 2.809 seconds
可以在此基础之上,通过crontab将shell脚本定义定时调度
联系客服