​Section 9:101.Overview of Numeric Functions

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:

  1. abs(x) – returns the absolute value of x.
  2. ceil(x) – returns the smallest integer that is greater than or equal to x.
  3. floor(x) – returns the largest integer that is less than or equal to x.
  4. round(x) – rounds x to the nearest integer.
  5. exp(x) – returns the exponential value of x.
  6. log(x) – returns the natural logarithm of x.
  7. log10(x) – returns the base-10 logarithm of x.
  8. sqrt(x) – returns the square root of x.
  9. power(x, y) – returns x raised to the power of y.
  10. mod(x, y) – returns the remainder of x divided by y.
  11. sin(x) – returns the sine of x.
  12. cos(x) – returns the cosine of x.
  13. tan(x) – returns the tangent of x.
  14. asin(x) – returns the arc sine of x.
  15. acos(x) – returns the arc cosine of x.
  16. atan(x) – returns the arc tangent of x.
  17. rand() – returns a random number between 0 and 1.

Share this post