Kaynağa Gözat

添加ods->dwd

wudianlong 2 yıl önce
ebeveyn
işleme
2e9afc03fe
1 değiştirilmiş dosya ile 6 ekleme ve 9 silme
  1. 6 9
      energy/dayTask/ods_to_dwd.sh

+ 6 - 9
energy/dayTask/ods_to_dwd.sh

@@ -13,13 +13,11 @@ echo $do_date
 
 env_config="
 use saga_dw;
-SET hive.vectorized.execution.enabled=false;
 SET mapreduce.job.queuename=default;
-SET hive.input.format=org.apache.hadoop.hive.ql.io.HiveInputFormat;
-SET hive.exec.dynamic.partition.mode=nonstrict;"
+"
 
 dwd_energy_15_min_hour="
-insert overwrite table saga_dw.dwd_energy_15_min_hour partition (dt)
+insert into table saga_dw.dwd_energy_15_min_hour partition (dt = '$do_date')
 select building,
        func_id,
        branch_type,
@@ -28,8 +26,7 @@ select building,
        hour_ as current_hour,
        current_year,
        year_mouth,
-       week_of_year,
-       dt
+       week_of_year
 from (
     select building,
            func_id,
@@ -56,10 +53,10 @@ from (
                data_value,
                dt
         from ods_energy_15_min oe15m
-        where dt >= '2022-01-01'
+        where dt = '$do_date'
            ) o15mh
           left join dim_office_meter dom on o15mh.meter = dom.meter
-      where dt >= '2022-01-01' and  branch_type in ('AP', 'AL')
+      where dt = '$do_date' and  branch_type in ('AP', 'AL')
       group by building, func_id, dt, o15mh.hour_ ) t1
     union
     select building,
@@ -78,7 +75,7 @@ from (
                data_value,
                dt
         from ods_energy_15_min oe15m
-        where dt >= '2022-01-01'
+        where dt = '$do_date'
          ) o15mh
         left join dim_office_meter dom2 on o15mh.meter = dom2.meter
     group by building, func_id, branch_type, branch_type_name, use_range_type, dt, o15mh.hour_