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;
set hive.jobname.length=100;

-- laxin
insert overwrite table dwh.gdt_data partition(day='${dt_today}',category='alipay_lahuo_laxin',business='laxin_0')
      select device_id
             from dwh.etl_alipay_acquisition_daily
      where dt='${dt_today}' and business='alipay_acquisition' and package_name='com.alipay.foracquisition_L00002';


insert overwrite table dwh.gdt_data partition(day='${dt_today}',category='alipay_lahuo_laxin',business='laxin_1')
      select device_id
             from dwh.etl_alipay_acquisition_daily
      where dt='${dt_today}' and business='alipay_acquisition' and package_name='com.alipay.foracquisition';


insert overwrite table dwh.gdt_data partition(day='${dt_today}',category='alipay_lahuo_laxin',business='laxin_2')
      select device_id
             from dwh.etl_alipay_acquisition_daily
      where dt='${dt_today}' and business='alipay_acquisition' and package_name='com.alipay.notforacquisition';


-- lahuo
insert overwrite table dwh.gdt_data partition(day='${dt_today}',category='alipay_lahuo_laxin',business='lahuo_0')
      select device_id
             from dwh.etl_alipay_activation_daily
      where dt='${dt_today}' and business='alipay_activation' and package_name='com.alipay.foractivation_L00016';

insert overwrite table dwh.gdt_data partition(day='${dt_today}',category='alipay_lahuo_laxin',business='lahuo_1')
      select device_id
             from dwh.etl_alipay_activation_daily
      where dt='${dt_today}' and business='alipay_activation' and package_name='com.alipay.foractivation_L00009';

insert overwrite table dwh.gdt_data partition(day='${dt_today}',category='alipay_lahuo_laxin',business='lahuo_2')
      select device_id
             from dwh.etl_alipay_activation_daily
      where dt='${dt_today}' and business='alipay_activation' and package_name='com.alipay.foractivation_L00008';

insert overwrite table dwh.gdt_data partition(day='${dt_today}',category='alipay_lahuo_laxin',business='lahuo_3')
      select device_id
             from dwh.etl_alipay_activation_daily
      where dt='${dt_today}' and business='alipay_activation' and package_name='com.alipay.foractivation_L00005';

insert overwrite table dwh.gdt_data partition(day='${dt_today}',category='alipay_lahuo_laxin',business='lahuo_4')
      select device_id
             from dwh.etl_alipay_activation_daily
      where dt='${dt_today}' and business='alipay_activation' and package_name='com.alipay.foractivation';

insert overwrite table dwh.gdt_data partition(day='${dt_today}',category='alipay_lahuo_laxin',business='lahuo_5')
      select device_id
             from dwh.etl_alipay_activation_daily
      where dt='${dt_today}' and business='alipay_activation' and package_name='com.alipay.notforactivation';



