首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

一个sql生成hive日期维度表

set hive.execution.engine=tez; with dates as ( select date_add("2010-01-01", a.pos) as d from (select posexplode(split(repeat("o", datediff("2030-12-31", "2010-01-01")), "o"))) a ) insert overwrite table dim.dim_date select     d   , date_format(d, 'yyyyMMdd000000') as to_pt            -- 指定分区格式   , date_format(d, 'yyyyMMdd')       as date_yyyymmdd   , trunc(d,'MM')                    as month_first_day    , last_day(d)                      as month_last_day   , date_format(last_day(d),'yyyyMMdd000000')   as month_last_pt   , date_format(d, 'yyyyMM')  as month_yyyymm   , date_format(d, 'yyyy-MM') as month_yyyy_mm   , month(d) as month   , date_format(d, 'u') as week   , date_format(d, 'E') as week_long      , weekofyear(d) as week_of_year   , year(d) as year   , floor(substr(d,6,2)/3.1)*3+1 as quarter   -- , concat_group('"',date_format(d, 'yyyyMM'),'"') as date_yyyymmdd_list   -- 低版本hive group_concat 不可用 from dates

03
您找到你想要的搜索结果了吗?
是的
没有找到

马斯克:我曾准备1/10价格把特斯拉卖给苹果,库克甚至都不见我

机器之心报道 编辑:李泽南、张倩 马斯克:「单电芯锂电池在化学上是不可能的,最大电压太低了。难道苹果要像特斯拉的结构电池组一样拼合电池吗?」 「苹果造车」的新闻在本周引发了人们的广泛讨论,不少造车新旧势力的高管们也开始发表自己的看法,有的表示欢迎,有的表示质疑。而对于目前风头正劲,市值全球第一高的车企特斯拉,马斯克爆料说仅仅在三年前他的公司还差点被苹果收购。 「在特斯拉 Model 3 项目陷入最低潮时期,我与蒂姆 · 库克曾进行接触,讨论苹果收购特斯拉的可能性,价格仅是目前市值的十分之一。库克拒绝了开

02
领券