kylin-剪枝优化工具-使用衍生维度

2020-02-21  本文已影响0人  李小李的路

衍生维度

CREATE TABLE `kylin_cal_dt`(
  `cal_dt` date COMMENT 'Date, PK', 
  `year_beg_dt` date COMMENT 'YEAR Begin Date', 
  `qtr_beg_dt` date COMMENT 'Quarter Begin Date', 
  `month_beg_dt` date COMMENT 'Month Begin Date', 
  `week_beg_dt` date COMMENT 'Week Begin Date', 
  `age_for_year_id` smallint, 
  `age_for_qtr_id` smallint, 
  `age_for_month_id` smallint, 
  `age_for_week_id` smallint, 
  `age_for_dt_id` smallint, 
  `age_for_rtl_year_id` smallint, 
  `age_for_rtl_qtr_id` smallint, 
  `age_for_rtl_month_id` smallint, 
  `age_for_rtl_week_id` smallint, 
  `age_for_cs_week_id` smallint, 
  `day_of_cal_id` int, 
  `day_of_year_id` smallint, 
  `day_of_qtr_id` smallint, 
  `day_of_month_id` smallint, 
  `day_of_week_id` int, 
  `week_of_year_id` tinyint, 
  `week_of_cal_id` int, 
  `month_of_qtr_id` tinyint, 
  `month_of_year_id` tinyint, 
  `month_of_cal_id` smallint, 
  `qtr_of_year_id` tinyint, 
  `qtr_of_cal_id` smallint, 
  `year_of_cal_id` smallint, 
  `year_end_dt` string, 
  `qtr_end_dt` string, 
  `month_end_dt` string, 
  `week_end_dt` string, 
  `cal_dt_name` string, 
  `cal_dt_desc` string, 
  `cal_dt_short_name` string, 
  `ytd_yn_id` tinyint, 
  `qtd_yn_id` tinyint, 
  `mtd_yn_id` tinyint, 
  `wtd_yn_id` tinyint, 
  `season_beg_dt` string, 
  `day_in_year_count` smallint, 
  `day_in_qtr_count` tinyint, 
  `day_in_month_count` tinyint, 
  `day_in_week_count` tinyint, 
  `rtl_year_beg_dt` string, 
  `rtl_qtr_beg_dt` string, 
  `rtl_month_beg_dt` string, 
  `rtl_week_beg_dt` string, 
  `cs_week_beg_dt` string, 
  `cal_date` string, 
  `day_of_week` string, 
  `month_id` string, 
  `prd_desc` string, 
  `prd_flag` string, 
  `prd_id` string, 
  `prd_ind` string, 
  `qtr_desc` string, 
  `qtr_id` string, 
  `qtr_ind` string, 
  `retail_week` string, 
  `retail_year` string, 
  `retail_start_date` string, 
  `retail_wk_end_date` string, 
  `week_ind` string, 
  `week_num_desc` string, 
  `week_beg_date` string, 
  `week_end_date` string, 
  `week_in_year_id` string, 
  `week_id` string, 
  `week_beg_end_desc_mdy` string, 
  `week_beg_end_desc_md` string, 
  `year_id` string, 
  `year_ind` string, 
  `cal_dt_mns_1year_dt` string, 
  `cal_dt_mns_2year_dt` string, 
  `cal_dt_mns_1qtr_dt` string, 
  `cal_dt_mns_2qtr_dt` string, 
  `cal_dt_mns_1month_dt` string, 
  `cal_dt_mns_2month_dt` string, 
  `cal_dt_mns_1week_dt` string, 
  `cal_dt_mns_2week_dt` string, 
  `curr_cal_dt_mns_1year_yn_id` tinyint, 
  `curr_cal_dt_mns_2year_yn_id` tinyint, 
  `curr_cal_dt_mns_1qtr_yn_id` tinyint, 
  `curr_cal_dt_mns_2qtr_yn_id` tinyint, 
  `curr_cal_dt_mns_1month_yn_id` tinyint, 
  `curr_cal_dt_mns_2month_yn_id` tinyint, 
  `curr_cal_dt_mns_1week_yn_ind` tinyint, 
  `curr_cal_dt_mns_2week_yn_ind` tinyint, 
  `rtl_month_of_rtl_year_id` string, 
  `rtl_qtr_of_rtl_year_id` tinyint, 
  `rtl_week_of_rtl_year_id` tinyint, 
  `season_of_year_id` tinyint, 
  `ytm_yn_id` tinyint, 
  `ytq_yn_id` tinyint, 
  `ytw_yn_id` tinyint, 
  `kylin_cal_dt_cre_date` string, 
  `kylin_cal_dt_cre_user` string, 
  `kylin_cal_dt_upd_date` string, 
  `kylin_cal_dt_upd_user` string)
COMMENT 'Date Dimension Table'
ROW FORMAT SERDE 
  'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' 
WITH SERDEPROPERTIES ( 
  'field.delim'=',', 
  'serialization.format'=',') 
STORED AS INPUTFORMAT 
  'org.apache.hadoop.mapred.TextInputFormat' 
OUTPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
  'hdfs://bigdata/user/hive/warehouse/kylin_cal_dt'
TBLPROPERTIES (
  'transient_lastDdlTime'='1580892438')
Join Condition:
KYLIN_SALES.PART_DT = KYLIN_CAL_DT.CAL_DT
上一篇下一篇

猜你喜欢

热点阅读