导航
- hive outline
- hive 数学函数
- 取整函数: round
- 指定精度取整函数: round
- 向下取整函数: floor
- 向上取整函数: ceil
- 取随机数函数: rand
- 二进制函数: bin
- 进制转换函数: conv
- 绝对值函数: abs
hive outline
链接
hive 数学函数
取整函数: round
返回double类型的整数值部分 (遵循四舍五入)
指定精度取整函数: round
语法:
round(double a, int d) 返回d位小数
向下取整函数: floor
向上取整函数: ceil
取随机数函数: rand
rand 每次执行都不一样 返回一个0到1范围内的随机数
语法:
rand(int seed) 得到一个稳定的随机数序列
二进制函数: bin
语法:
bin(BIGINT a)
进制转换函数: conv
语法:
conv(BIGINT num/STRING num, int from_base, int to_base)
将数字 num 或者字符串 num 从 from_base 进制转换到 to_base 进制
绝对值函数: abs