#!/usr/sh

DT=$(date +%Y%m%d -d "-1 day $ScheduleTime")

sqoop import "-Dorg.apache.sqoop.splitter.allow_text_splitter=true" --connect jdbc:mysql://dataplatform-app-tag.c5yzcdreb1xr.us-east-1.rds.amazonaws.com:3306/app_tag  \
    --username apptag_rw --password 7gyLEVtkER3u8c9 --table tag_result --columns 'package_name,app_name,platform,feat_id' -m 1 --null-string '\\N' --null-non-string '\\N' \
    --target-dir 's3://mob-emr-test/wangjf/data/dwh/app_tag' --fields-terminated-by '\001' --delete-target-dir

# USE dev;
# CREATE EXTERNAL TABLE app_tag(
#   package_name string,
#   app_name string,
#   platform string,
#   category string
# ) ROW FORMAT DELIMITED
# FIELDS TERMINATED BY '\001'
# STORED AS TEXTFILE
# LOCATION 's3://mob-emr-test/wangjf/data/dwh/app_tag';