Hive provides a wide range of numeric functions that can be used for performing arithmetic, trigonometric, statistical, and other mathematical operations on numeric data. Here is an overview of some of the commonly used numeric functions in Hive:
- abs(x) – returns the absolute value of x.
- ceil(x) – returns the smallest integer that is greater than or equal to x.
- floor(x) – returns the largest integer that is less than or equal to x.
- round(x) – rounds x to the nearest integer.
- exp(x) – returns the exponential value of x.
- log(x) – returns the natural logarithm of x.
- log10(x) – returns the base-10 logarithm of x.
- sqrt(x) – returns the square root of x.
- power(x, y) – returns x raised to the power of y.
- mod(x, y) – returns the remainder of x divided by y.
- sin(x) – returns the sine of x.
- cos(x) – returns the cosine of x.
- tan(x) – returns the tangent of x.
- asin(x) – returns the arc sine of x.
- acos(x) – returns the arc cosine of x.
- atan(x) – returns the arc tangent of x.
- rand() – returns a random number between 0 and 1.