我终于加班结束了
当Hive菜鸡真累
Hive怎么通过查询生成一列时间呢(我为此百度了一晚上,虽然还在写别的东西),如下
SELECT
date_add("2020-06-01", a.x-1) AS time_belong
FROM
(
SELECT
ROW_NUMBER() OVER(ORDER BY EXPLODE(SPLIT(REPEAT("o", DATEDIFF("2020-06-30", "2020-06-01")), "o"))) AS x
) AS a
其实思路很简单,要N天,就重复N次,然后行转列,然后调用 ROW NUMBER