####### execute hive ######
sql=$(cat <<!EOF
USE pmp;
set mapred.queue.names=queue3;
drop table if exists people_targeted_delivery;
create table people_targeted_delivery
( special_tag_id int,
cnt bigint
);
INSERT OVERWRITE LOCAL DIRECTORY '$cur_path/people_targeted_delivery'
ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'
select special_tag_id,count(1)
from t_pmp_special_user_tags
group by special_tag_id;
!EOF)
############ execute begin ###########echo$sql$HIVE_HOME/bin/hive -e"$sql"exitCode=$?
if [ $exitCode-ne0 ];thenecho"[ERROR] hive execute failed!"exit$exitCodefi