create table if not exists dim_date (
date_id string comment ‘日期(yyyymmdd)’
,datestr string comment ‘日期(yyyy-mm-dd)’
,date_name string comment ‘日期名称中文’
,weekid int comment ‘周(0-6,周日~周六)’
,week_cn_name string comment ‘周_名称_中文’
,week_en_name string comment ‘周_名称_英文’
,week_en_nm string comment ‘周_名称_英文缩写’
,yearmonthid string comment ‘月份id(yyyymm)’
,yearmonthstr string comment ‘月份(yyyy-mm)’
,monthid int comment ‘月份id(1-12)’
,monthstr string comment ‘月份’
,month_cn_name string comment ‘月份名称_中文’
,month_en_name string comment ‘月份名称_英文’
,month_en_nm string comment ‘月份名称_简写_英文’
,quarterid int comment ‘季度id(1-4)’
,quarterstr string comment ‘季度名称’
,quarter_cn_name string comment ‘季度名称_中文’
,quarter_en_name string comment ‘季度名称_英文’
,quarter_cn_nm string comment ‘季度名称_简写中文’
,quarter_en_nm string comment ‘季度名称_简写英文’
,yearid int comment ‘年份id’
,year_cn_name string comment ‘年份名称_中文’
,year_en_name string comment ‘年份名称_英文’
,month_start_date string comment ‘当月1号(yyyy-mm-dd)’
,month_end_date string comment ‘当月最后日期(yyyy-mm-dd)’
,month_timespan int comment ‘月跨天数’
,week_of_year int comment ‘当年第几周’
,workday_flag string comment ‘是否工作日(周一至周五Y,否则:N)’
,weekend_flag string comment ‘是否周末(周六和周日Y,否则:N)’
)comment ‘日期维度表’
stored as parquet;
参考文档
https://blog.csdn.net/u010918936/article/details/125189554