set  hive.exec.dynamic.partition.mode=nonstrict;
set  hive.exec.dynamic.partition=true;
set mapred.max.split.size=536870912;
set mapred.min.split.size.per.node=536870912;
set mapred.min.split.size.per.rack=536870912;
set mapreduce.map.memory.mb=4000;
set mapreduce.map.java.opts=-Xmx3000m;
set mapreduce.reduce.memory.mb=3072;
set mapreduce.reduce.java.opts=-Xmx2458m;


insert overwrite table dwh.gdt_data partition(day='${dt_today}',category='uc_lahuo',business='imei_0')
      select device_id
             from dwh.dm_install_list_v2
      where dt='${dt_today}' and business="uc_activation" and package_name='com.uc.foractivation.33c777' and device_type='imeimd5';


insert overwrite table dwh.gdt_data partition(day='${dt_today}',category='uc_lahuo',business='imei_1')
      select device_id
             from dwh.dm_install_list_v2
      where dt='${dt_today}' and business="uc_activation" and package_name='com.uc.foractivation.4b5a58' and device_type='imeimd5';

insert overwrite table dwh.gdt_data partition(day='${dt_today}',category='uc_lahuo',business='imei_2')
      select device_id
             from dwh.dm_install_list_v2
      where dt='${dt_today}' and business="uc_activation" and package_name='com.uc.foractivation.304fcd' and device_type='imeimd5';


insert overwrite table dwh.gdt_data partition(day='${dt_today}',category='uc_lahuo',business='imei_3')
      select device_id
             from dwh.dm_install_list_v2
      where dt='${dt_today}' and business="uc_activation" and package_name='com.uc.foractivation.d3f521' and device_type='imeimd5';


insert overwrite table dwh.gdt_data partition(day='${dt_today}',category='uc_lahuo',business='imei_4')
      select device_id
             from dwh.dm_install_list_v2
      where dt='${dt_today}' and business="uc_activation" and package_name='com.uc.foractivation_imei'  and device_type='imeimd5';


insert overwrite table dwh.gdt_data partition(day='${dt_today}',category='uc_lahuo',business='imei_5')
      select device_id
             from dwh.dm_install_list_v2
      where dt='${dt_today}' and business="uc_activation" and package_name='com.uc.notforactivation_imei'  and device_type='imeimd5';



-- oaid
insert overwrite table dwh.gdt_data partition(day='${dt_today}',category='uc_lahuo',business='oaid_2')
      select device_id
             from dwh.dm_install_list_v2
      where dt='${dt_today}' and business="uc_activation" and package_name='com.uc.foractivation_oaid'  and device_type='oaidmd5';

insert overwrite table dwh.gdt_data partition(day='${dt_today}',category='uc_lahuo',business='oaid_3')
      select device_id
             from dwh.dm_install_list_v2
      where dt='${dt_today}' and business="uc_activation" and package_name='com.uc.notforactivation_oaid'  and device_type='oaidmd5';

insert overwrite table dwh.gdt_data partition(day='${dt_today}',category='uc_lahuo',business='oaid_5')
      select device_id
             from dwh.dm_install_list_v2
      where dt='${dt_today}' and business="uc_activation" and package_name='com.uc.foractivation.4b5a58'  and device_type='oaidmd5';

insert overwrite table dwh.gdt_data partition(day='${dt_today}',category='uc_lahuo',business='oaid_6')
      select device_id
             from dwh.dm_install_list_v2
      where dt='${dt_today}' and business="uc_activation" and package_name='com.uc.foractivation.aff149'  and device_type='oaidmd5';


