hive 求今年的天数和今年过了多少天,类似mysql:所在年天数:select DAYOFYEAR(CONCAT(YEAR(NOW()),'-12-31'))这样的函数。
过了多少天:DAYOFYEAR(now())
两个日期相减就行了
https://www.cnblogs.com/ShadowFiend/p/12888055.html
select
datediff(concat(year(current_date),'-12-31'),concat(year(current_date)-1,'-12-31')) as aaa, --今年多少天
datediff(current_date,concat(year(current_date)-1,'-12-31')) as bbb -- 今年过了多少天
from 表