hive内置函数大全

帅比萌擦擦* 提交于 2020-10-02 06:24:27
DOUBLE|round(DOUBLE a)|Returns the rounded BIGINT value of a.返回对a四舍五入的BIGINT值
DOUBLE|round(DOUBLE a, INT d)|Returns a rounded to d decimal places.返回DOUBLE型d的保留n位小数的DOUBLW型的近似值
DOUBLE|bround(DOUBLE a)|Returns the rounded BIGINT value of a using HALF_EVEN rounding mode (as of Hive 1.3.0, 2.0.0). Also known as Gaussian rounding or bankers' rounding. Example: bround(2.5) = 2, bround(3.5) = 4.银行家舍入法(1~4:舍,6~9:进,5->前位数是偶:舍,5->前位数是奇:进)
DOUBLE|bround(DOUBLE a, INT d)|Returns a rounded to d decimal places using HALF_EVEN rounding mode (as of Hive 1.3.0, 2.0.0). Example: bround(8.25, 1) = 8.2, bround(8.35, 1) = 8.4.银行家舍入法,保留d位小数
BIGINT|floor(DOUBLE a)|Returns the maximum BIGINT value that is equal to or less than a向下取整,最数轴上最接近要求的值的左边的值  如:6.10->6   -3.4->-4
BIGINT|ceil(DOUBLE a), ceiling(DOUBLE a)|Returns the minimum BIGINT value that is equal to or greater than a.求其不小于小给定实数的最小整数如:ceil(6) = ceil(6.1)= ceil(6.9) = 6
DOUBLE|rand(), rand(INT seed)|Returns a random number (th
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!