背景: 工作中多次使用到hql的时间转换,但一直未记录相关文档,每次查找都十分麻烦,故文档记录方便下次使用。
查找 hive 自带函数
- 展示hive内置的所有函数
show functions;
- 函数使用方法的查询
desc function year;
注意:
- 在beeline中,直接
desc function current_date;
可能会报错; - 可能是因为下划线识别出错
- 解决方案:
desc function `current_date`;
hive 自带的日期函数的使用
-
current_date
-
current_timestamp
-
unix_timestamp
-
year
-
from_unixtime1
-
date_format1
date_format2
date_format3
-
date_add1
date_add2
-
add_months
网友评论