saga_dw_ods.sql 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. drop table if exists ods_energy_week_day;
  2. create table if not exists ods_energy_week_day (
  3. id integer,
  4. project_id string comment "项目id",
  5. `date` string comment "yyyyMMdd,日期",
  6. energy_cooling decimal(10, 4) comment "中央供冷系统,能耗",
  7. energy_heating decimal(10, 4) comment "中央供热系统,能耗",
  8. energy_ac_terminal decimal(10, 4) comment "空调末端系统,能耗",
  9. energy_light decimal(10, 4) comment "照明系统,能耗",
  10. energy_others decimal(10, 4) comment "其它,能耗",
  11. create_time string comment "创建时间",
  12. update_time string comment "更新时间"
  13. ) COMMENT '能耗系统'
  14. ROW FORMAT DELIMITED FIELDS TERMINATED BY '\001'
  15. STORED AS TEXTFILE
  16. LOCATION
  17. 'hdfs://sagaCluster:8020/warehouse/saga_dw/ods/ods_energy_week_day'
  18. TBLPROPERTIES (
  19. 'orc.compress'='lzo');
  20. /** 历史数据 */
  21. create table ods_energy_15_min_history
  22. (
  23. building string,
  24. func_id string,
  25. meter string,
  26. data_time string,
  27. data_value decimal(20, 15),
  28. `dt` string
  29. ) COMMENT '能源原始数据15min历史数据'
  30. partitioned by (`dt` string)
  31. ROW FORMAT DELIMITED FIELDS TERMINATED BY '\001'
  32. STORED AS TEXTFILE
  33. LOCATION
  34. 'hdfs://sagaCluster:8020/warehouse/saga_dw/ods/ods_energy_15_min_history'
  35. TBLPROPERTIES (
  36. 'orc.compress'='lzo');