#!/bin/bash
#CURR_DATE=`date +"%Y-%m-%d %H:%M:%S"`------>不能使用
v_sql="insert into origin_ennenergy_energytrade.test2 values('"$(date +"%Y-%m-%d %H:%M:%S")"','"Y"')"
echo $v_sql
#insert into origin_ennenergy_energytrade.test2 values('2016-08-09 10:39:44','Y')
hive -e "$v_sql;"
sqoop export --connect jdbc:mysql://ip:3306/test23?characterEncoding=utf8 --username root --password 123--table test2--export-dir /user/hive/warehouse/origin_ennenergy_energytrade.db/test2/* --input-fields-terminated-by "\t" --update-mode allowinsert --update-key times;