宇智波鼬为什么叫鼬神:Shell调度hive程序

来源:百度文库 编辑:中财网 时间:2024/04/29 11:21:06

Shell调度hive程序

(2011-05-30 17:59:09) 标签:

hive

it

分类: 云计算

1新建shell脚本

hive> afan@ubuntu:/usr/local/hadoop$ cattest.sh

#!/bin/bash

source/home/afan/.bashrc

#HQL

hive<

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] ["what","are","this"]

[34,45,34,23,12]    ["who","am","i","are"]

Timetaken: 2.809 seconds

可以在此基础之上,通过crontab将shell脚本定义定时调度