作者:嗯啊发送到法国_574 | 来源:互联网 | 2023-05-18 14:45
mysql-hxxx-P3306-uxxxx-pxxxtest_bi-s-e\selectm_ip,m_user,m_passwd,m_db,m_port,m_tabl
mysql -hxxx -P3306 -uxxxx -pxxx test_bi -s -e \
"select m_ip,m_user,m_passwd,m_db,m_port,m_table,h_db,h_table,conditions from t_sqoop_task_info where is_valid=1 and task_id=67 limit 1" \
| while read m_ip m_user m_passwd m_db m_port m_table h_db h_table conditions
do
m_cOnditions=${conditions//'$'dt/`echo $time`}
echo ${m_ip}...${m_user}...${m_passwd}...${m_db}...${m_port}...${m_table}...${h_db}...${h_table}
read ct <<<$(echo `mysql -h$m_ip -P$m_port -u$m_user -p$m_passwd -D$m_db -s -e "select count(*) ct from $m_table where $m_conditions"`)
echo mysql -h$m_ip -P$m_port -u$m_user -p$m_passwd -D$m_db -s -e "select count(*) ct from $m_table where $m_conditions"
echo -e "${h_db}\t${h_table}\t${ct}" >> $data_path
done