use emr_doppler;

DROP TABLE event_${date_str_undline};
create external table IF NOT EXISTS event_${date_str_undline}(
    `version` smallint,
    game_id int,
    user_id string,
    player_id string,
    arrival_ts string,
    install_ts string,
    category string,
    session_id string,
    event_id string,
    country_code string,
    ip string,
    revenue string,
    facebook_id string,
    googleplus_id string,
    ios_id string,
    android_id string,
    google_aid string,
    ios_idfa string,
    ios_idfv string,
    is_ad_tracking_limited boolean,
    is_logged_gamecenter boolean,
    is_logged_googleplay boolean,
    value double,
    attempt_num bigint,
    score bigint,
    session_num bigint,
    session_length bigint,
    gender string,
    birth_year string,
    progression string,
    sdk_version string,
    engine_version string,
    os_version string,
    manufacturer string,
    device string,
    platform string,
    build string,
    connection_type string,
    is_jailbroken boolean,
    pay_ft string,
    currency string,
    amount double,
    cart_type string,
    transaction_num bigint,
    receipt_status string,
    v1_os_major string,
    v1_device string,
    v1_platform string,
    v1_gender string,
    v1_sdk_version string,
    v1_google_aid string,
    v1_android_id string,
    v2_category string,
    install_publisher string,
    install_site string,
    install_campaign string,
    install_adgroup string,
    install_ad string,
    install_keyword string,
    severity string
)
row format delimited fields terminated by '|'
stored as orc
location 's3://mob-emr-test/dataplatform/emr/ga_rawdata/${prefix}/';