#!/usr/sh

DT=$1

LAST_DT=$(date +%Y%m%d -d "-7 day $DT")

hive -hivevar dt=${DT} -hivevar last_dt=${LAST_DT} -f base.sql

# sqoop eval --connect jdbc:mysql://192.168.32.128:3306/app_tag  \
#       --username root --password 19920627 --table tag_list --columns "package_name,app_name,category_list,track_view_url,install_nums" \
#       --export-dir s3://mob-emr-test/dataplatform/DataWareHouse/dwh.db/package_list --input-fields-terminated-by '\001'


hive -e "USE dwh;DROP TABLE IF EXISTS package_list_${dt};"