i=1
while [ $i -le 4 ]
do

beeline -u jdbc:hive2://localhost:10000  --maxWidth=1000 -f  ./MT/mt_${i}/ddl.sql  > ./logs/mt_ddl_${i}.out 2>&1

startdate=`date +%m-%d-%H:%M:%S.%2N`
echo "Refresh $i AUDIT START date: ${startdate}"
echo "Refresh $i AUDIT START date: ${startdate}" > ./logs/Update_data_check_${i}.out
echo "cat delete_$i.dat"  >> ./logs/Update_data_check_${i}.out
cat /mnt/disk1/data/delete_$i.dat >> ./logs/Update_data_check_${i}.out
echo "cat inventory_delete_$i.dat"  >> ./logs/Update_data_check_${i}.out
cat /mnt/disk1/data/inventory_delete_$i.dat >> ./logs/Update_data_check_${i}.out
hdfs dfs -dus /user/beeline/tpcds/mt/${i}/* >> ./logs/Update_data_check_${i}.out

beeline -u jdbc:hive2://localhost:10000  --maxWidth=1000 -f  ./MT/Update_table_rowcount.sql >> ./logs/Update_data_check_${i}.out 2>&1

enddate=`date +%m-%d-%H:%M:%S.%2N`
echo "Refresh $i AUDIT END date: ${enddate}"
echo "Refresh $i AUDIT END date: ${enddate}" >> ./logs/Update_data_check_${i}.out


((i++))
done




