Apache Tajo – Math Functions

Math functions operate on mathematical formulae. The following table describes the list of functions in detail.

S.No.Function & Description
1abs(x)Returns the absolute value of x.
2cbrt(x)Returns the cube root of x.
3ceil(x)Returns x value rounded up to the nearest integer.
4floor(x)Returns x rounded down to the nearest integer.
5pi()Returns pi value. Result will be returned as double value.
6radians(x)converts the angle x in degree radians.
7degrees(x)Returns degree value for x.
8pow(x,p)Returns power of value‘p’ to the x value.
9div(x,y)Returns the division result for the given two x,y integer values.
10exp(x)Returns Euler’s number e raised to the power of a number.
11sqrt(x)Returns the square root of x.
12sign(x)Returns the signum function of x, that is −0 if the argument is 01 if the argument is greater than 01 if the argument is less than 0
13mod(n,m)Returns the modulus (remainder) of n divided by m.
14round(x)Returns the rounded value for x.
15cos(x)Returns the cosine value(x).
16asin(x)Returns the inverse sine value(x).
17acos(x)Returns the inverse cosine value(x).
18atan(x)Returns the inverse tangent value(x).
19atan2(y,x)Returns the inverse tangent value(y/x).

Data Type Functions

The following table lists out the data type functions available in Apache Tajo.

S.No.Function & Description
1to_bin(x)Returns the binary representation of integer.
2to_char(int,text)Converts integer to string.
3to_hex(x)Converts the x value into hexadecimal.

Leave a Reply