简单的shell脚本 执行hive

#!/bin/bash
source /etc/profile
locate emg4051:/opt/software/hive/bin/hive
data=`date +%Y%m%d`

echo "启动hive ``````"
echo "创建临时表emg_tmpcxb ${data}"
hive -e "
drop table if exists emg_tmpcxb;
create table if not exists emg_tmpcxb(utc string)row format delimied fields 
terminated by '\t' as select utc from  emg.d181119 limit 5;
"
echo "建表成功 导入数据SUCCESS ${data}"

猜你喜欢

转载自blog.csdn.net/weixin_41804049/article/details/84998050