欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Hive round floor ceil 用法

程序员文章站 2024-02-27 18:00:15
...

round  四舍五入

floor 取左值

ceil 取右值

hive> select round(1.2356);
OK
1.0
Time taken: 0.871 seconds, Fetched: 1 row(s)
hive> select round(1.6356);
OK
2.0
Time taken: 0.163 seconds, Fetched: 1 row(s)
hive> select floor(1.2356);
OK
1
Time taken: 0.407 seconds, Fetched: 1 row(s)
hive> select floor(1.6356);
OK
1
Time taken: 2.447 seconds, Fetched: 1 row(s)
hive> select ceil(1.2356);
OK
2
Time taken: 0.207 seconds, Fetched: 1 row(s)
hive> select ceil(1.6356);
OK
2
Time taken: 0.189 seconds, Fetched: 1 row(s)
hive> 

end