Math Functions

Abs

Computes the absolute value.

Input Parameters: Column arg0

arg0 (required) - The column for which absolute value to be calculated.

Output TypeNumber Column
Configuration ParametersNo
ReturnsThe computed absolute value.
ThrowsApplication Exception

Use Case:

abs

Example:

abs(77.76) will return 77.76


Acos

Computes the cosine inverse of the given value; the returned angle is in the range 0.0 through pi.

Input Parameters: Column arg0

arg0 (required) - The column for which cosine inverse to be calculated.

Output TypeNumber Column
Configuration ParametersNo
ReturnsThe computed cosine inverse in the range 0.0 through pi.
ThrowsApplication Exception

Use Case:

acos

Example:

acos(0.45) will return 1.104031001096478


Asin

Computes the sine inverse of the given value; the returned angle is in the range -pi/2 through pi/2.

Input Parameters: Column arg0

arg0 (required) - The column for which sine inverse to be calculated.

Output TypeNumber Column
Configuration ParametersNo
ReturnsThe computed sine inverse in the range -pi/2 through pi/2.
ThrowsApplication Exception

Use Case:

asin

Example:

asin(0.45) will return 0.4667653256984187


Atan

Computes the tangent inverse of the given value.

Input Parameters: Column arg0

arg0 (required) - The column for which tangent inverse to be calculated.

Output TypeNumber Column
Configuration ParametersNo
ReturnsThe computed the tangent inverse.
ThrowsApplication Exception

Example:

atan(0.45) will return 0.42285391621948626


Atan2

Computes the angle theta from the conversion of rectangular coordinates (arg0, arg1) to polar coordinates (arg1, theta).

Input Parameters: Column arg0, Column arg1

  • arg0 (required) - The column for the x rectangular coordinate.

  • arg1 (required) - The column for the y rectangular coordinate.

Output TypeNumber Column
Configuration ParametersNo
ReturnsThe computed angle theta.
ThrowsApplication Exception

Use Case:

atan_2

Example:

atan2(12, 71.21) will return 1.403849169952035


Atan2_left_arg_double

Computes the angle theta from the conversion of rectangular coordinates (arg0, arg1) to polar coordinates (arg1, theta).

Input Parameters: double arg0, Column arg1

  • arg0 (required) - The x rectangular coordinate.

  • arg1 (required) - The column for the y rectangular coordinate.

Output TypeNumber Column
Configuration ParametersNo
ReturnsThe computed angle theta.
ThrowsApplication Exception

Use Case:

atan_21

Example:

atan2_left_arg_double(12, 71.21) will return 1.403849169952035


Atan2_right_arg_double

Computes the angle theta from the conversion of rectangular coordinates (arg0, arg1) to polar coordinates (arg1, theta).

Input Parameters: Column arg0, double arg1

  • arg0 (required) - The column for the x rectangular coordinate.

  • arg1 (required) - The y rectangular coordinate.

Output TypeNumber Column
Configuration ParametersNo
ReturnsThe computed angle theta.
ThrowsApplication Exception

Use Case:

right_arg

Example:

atan2_right_arg_double(12, 71.21) will return 1.403849169952035.


Bround

Computes the value of the column arg0 rounded to 0 decimal places with HALF_EVEN round mode.

Input Parameters: Column arg0

arg0 (required) - The column for which value rounded to 0 decimal places with HALF_EVEN round mode to be calculated

Output TypeNumber Column
Configuration ParametersNo
ReturnsThe computed value
ThrowsApplication Exception

Use Case:

brond

Example:

bround(71.21) will return 71.0


Bround_with_scale

Round the value of arg0 to arg1 decimal places with HALF_EVEN round mode if arg1 is greater than or equal to 0 or at integral part when arg1 is less than 0.

Input Parameters: Column arg0, int arg1

  • arg0 (required) - The column for which value rounded to 0 decimal places with HALF_EVEN round mode to be calculated.

  • arg1 (required) - The scale to use

Output TypeNumber Column
Configuration ParametersNo
ReturnsThe computed value.
ThrowsApplication Exception

Use Case:

bround_scale

Example:

bround_with_scale(71.21, 1) will return 71.2.


Cbrt

Computes the cube-root of the given column.

Input Parameters: Column arg0

arg0 (required) - The column for which cube-root to be calculated.

Output TypeNumber Column
Configuration ParametersNo
ReturnsThe computed cube-root.
ThrowsApplication Exception

Use Case:

cbrt1

Example:

cbrt(80.89) will return 4.324789202233814


Ceil

Computes the ceiling of the given column.

Input Parameters: Column arg0

  • arg0 (required) - The column for which ceiling to be calculated.
Output TypeNumber Column
Configuration ParametersNo
ReturnsThe computed ceiling.
ThrowsApplication Exception

Example:

ceil(77.76) will return 4.2682720044742055


Conv

Converts a number column from a given base to another.

Input Parameters: Column arg0,Column args1,Column args2

  • arg0 (required) - A number/String number column

  • arg1 (required) - Integer column of base from which a number is to be converted

  • arg2 (required) - Integer column of base to which a number is to be converted.

Output TypeString Column
Configuration ParametersNo
ReturnsThe string in the target base.
ThrowsApplication Exception

Use Case:

conv

Example:

conv(258,10,2) will return 100000010


Cos

Computes the cosine of the given value.

Input Parameters: Column arg0

  • arg0 (required) - The column for which cosine to be calculated.
Output TypeNumber Column
Configuration ParametersNo
ReturnsThe computed cosine.
ThrowsApplication Exception

Use Case:

cos

Example:

cos(76.56) will return 0.3977126102073901


Cosh

Computes the hyperbolic cosine of the given value.

Input Parameters: Column arg0

  • arg0 (required) -The column for which hyperbolic cosine to be calculated.
Output TypeNumber Column
Configuration ParametersNo
ReturnsThe computed hyperbolic cosine.
ThrowsApplication Exception

Use Case:

cosh-2

Example:

cos(76.56) will return 0.3977126102073901


Degrees

Converts an angle measured in radians to an approximately equivalent angle measured in degrees.

Input Parameters: Column arg0

  • arg0 (required) -The column for which the equivalent angle measured in degrees to be calculated.
Output TypeNumber Column
Configuration ParametersNo
ReturnsThe converted angle measured in degrees.
ThrowsApplication Exception

Use Case:

degrees

Example:

degrees(71.21) will return 4080.0324066707394


Exp

Computes the exponential of the given value.

Input Parameters: Column arg0

  • arg0 (required) -The column for which exponential to be calculated.
Output TypeNumber Column
Configuration ParametersNo
ReturnsThe computed exponential.
ThrowsApplication Exception

Use Case:

exp

Example:

exp(0.78) will return 2.18147220308578


Expm1

Computes the exponential of the given value minus one.

Input Parameters: Column arg0

  • arg0 (required) -The column for which exponential minus one to be calculated.
Output TypeNumber Column
Configuration ParametersNo
ReturnsThe computed value.
ThrowsApplication Exception

Use Case:

expm1

Example:

expm1(0.23) will return 0.2586000151807663


Factorial

Computes the factorial of the given value.

Input Parameters: Column arg0

  • arg0 (required) -The column for which factorial to be calculated.
Output TypeNumber Column
Configuration ParametersNo
ReturnsThe computed factorial.
ThrowsApplication Exception

Use Case:

factorial

Example:

factorial(11) will return 39916800


Floor

Computes the floor of the given column.

Input Parameters: Column arg0

  • arg0 (required) -The column for which floor to be calculated.
Output TypeNumber Column
Configuration ParametersNo
ReturnsReturns the computed floor.
ThrowsApplication Exception

Use Case:

floor

Example:

floor(71.21) will return 71


Format_number

Formats numeric column arg0 to a format like ‘#,###,###.##’, rounded to arg1 decimal places, and returns the result as a string column.

Input Parameters: Column arg0, int arg1

  • arg0 (required) -The column to be formated.

  • arg1 (required) -The integer specifying the decimal places to be used for rounding.

Output TypeNumber Column
Configuration ParametersNo
ReturnsReturns the formatted result as a string column.
ThrowsApplication Exception

Example:

format_number(7120.12, 1) will return 7,120.1


Greatest

It gives the greatest value of the list of values. This function takes at least 2 parameters.

Input Parameters: Column arg0,Column args1,…

  • arg0 (required) -A column from the schema

  • arg1 (required) -A column from the schema

Output TypeNumber Column
Configuration ParametersNo
ReturnsThe greatest column
ThrowsApplication Exception

Use Case:

gretaest

Example:

greatest(258,259) will return 259


Hex

If the argument is an INT, hex returns the number as a STRING in hexadecimal format. Otherwise if the number is a STRING, it converts each character into its hexadecimal representation and returns the resulting STRING.

Input Parameters: Column arg0

  • arg0 (required) -A int/string column
Output TypeString Column
Configuration ParametersNo
ReturnsA string value.
ThrowsApplication Exception

Use Case:

hex

Example:

hex(258) will return 102


Hypot

Computes sqrt(arg0^2^ + arg1^2^) without intermediate overflow or underflow.

Input Parameters: Column arg0, Column arg1

  • arg0 (required) -Will be used while computing sqrt.

  • arg1 (required) -Will be used while computing sqrt.

Output TypeNumber Column
Configuration ParametersNo
ReturnsReturns the computed sqrt(arg0^2^ + arg1^2^).
ThrowsApplication Exception

Use Case:

hypot

Example:

hypot(71.21, 10.5) will return 71.97995533209642


Hypot_left_arg_double

Computes sqrt(arg0^2^ + arg1^2^) without intermediate overflow or underflow.

Input Parameters: double arg0, Column arg1

  • arg0 (required) -Will be used while computing sqrt.

  • arg1 (required) -Will be used while computing sqrt.

Output TypeNumber Column
Configuration ParametersNo
ReturnsReturns the computed sqrt(arg0^2^ + arg1^2^).
ThrowsApplication Exception

Use Case:

hypo-left

Example:

hypot_left_arg_double(71.21, 10.5) will return 71.97995533209642


Hypot_right_arg_double

Computes sqrt(arg0^2^ + arg1^2^) without intermediate overflow or underflow.

Input Parameters: Column arg0, double arg1

  • arg0 (required) -Will be used while computing sqrt.

  • arg1 (required) -Will be used while computing sqrt.

Output TypeNumber Column
Configuration ParametersNo
ReturnsReturns the computed sqrt(arg0^2^ + arg1^2^).
ThrowsApplication Exception

Use Case:

hypo_right

Example:

hypot_right_arg_double(71.21, 10.5) will return 71.97995533209642


Least

It gives the least value of the list of values. This function takes at least 2 parameters.

Input Parameters: Column arg0,Column args1,…

  • arg0 (required) - A column from the schema.

  • arg1 (required) - A column from the schema.

Output TypeNumber Column
Configuration ParametersNo
ReturnsReturns the least column
ThrowsApplication Exception

Use Case:

least

Example:

least(258,259) will return 259


Log

Computes the natural logarithm of the given value.

Input Parameters: Column arg0

  • arg0 (required) - The column for which natural logarithm to be calculated.
Output TypeNumber Column
Configuration ParametersNo
ReturnsReturns the computed natural logarithm.
ThrowsApplication Exception

Use Case:

log

Example:

log(20) will return 2.995732273553991


Log1p

Computes the natural logarithm of the given value plus one.

Input Parameters: Column arg0

  • arg0 (required) - The column for which natural logarithm plus one to be calculated.
Output TypeNumber Column
Configuration ParametersNo
ReturnsReturns the computed natural logarithm plus one.
ThrowsApplication Exception

Example:

log1p(20) will return 3.044522437723423


Log_with_base

Computes the first argument-base logarithm of the second argument.

Input Parameters: double arg0, Column arg1

  • arg0 (required) - The base to used.

  • arg1 (required) - The column for which logarithm to be calculated.

Output TypeNumber Column
Configuration ParametersNo
ReturnsReturns the computed algorithm.
ThrowsApplication Exception

Use Case:

log_with_base

Example:

log_with_base(10, 20) will return 1.301029995663981


Negate

Computes the Unary minus, i.e. -(arg0)

Input Parameters: Column arg0

  • arg0 (required) - The column for which unary minus to be calculated.
Output TypeNumber Column
Configuration ParametersNo
ReturnsReturns the computed Unary minus, i.e. -(arg0).
ThrowsApplication Exception

Example:

negate(20) will return -20


Pmod

Computes the positive value of arg0 mod arg1.

Input Parameters: Column arg0, Column arg1

  • arg0 (required) - The dividend.

  • arg1 (required) - The divisor.

Output TypeNumber Column
Configuration ParametersNo
ReturnsReturns the computed positive value of arg0 mod arg1.
ThrowsApplication Exception

Use Case:

pmod

Example:

pmod(19, 0.78) will return 0.2800007


Pow

Computes the value of the first argument raised to the power of the second argument.

Input Parameters: Column arg0, Column arg1

  • arg0 (required) - The base.

  • arg1 (required) - The exponent.

Output TypeNumber Column
Configuration ParametersNo
ReturnsReturns the computed value
ThrowsApplication Exception

Use Case:

pow

Example:

pow(20, 2) will return 400


Pow_left_arg_double

Computes the value of the first argument raised to the power of the second argument.

Input Parameters: double arg0, Column arg1

  • arg0 (required) - The base.

  • arg1 (required) - The exponent

Output TypeNumber Column
Configuration ParametersNo
ReturnsReturns the compute value
ThrowsApplication Exception

Use Case:

pow_left_double

Example:

pow_left_arg_double(20, 2) will return 400


Pow_right_arg_double

Computes the value of the first argument raised to the power of the second argument.

Input Parameters: Column arg0, double arg1

  • arg0 (required) - The base.

  • arg1 (required) - The exponent

Output TypeColumn
Configuration ParametersNo
ReturnsReturns the computed value.
ThrowsApplication Exception

Use Case:

pow_right

Example:

pow_right_arg_double(20, 2) will return 400


Radians

Converts an angle measured in degrees to an approximately equivalent angle measured in radians.

Input Parameters: Column arg0

  • arg0 (required) - The column for which equivalent angle measured in radians to be calculated.
Output TypeNumber Column
Configuration ParametersNo
ReturnsReturns the converted angle measured in radians.
ThrowsApplication Exception

Use Case:

radians

Example:

radians(20) will return 0.3490658503988659


Rand

Generate a random column with independent and identically distributed (i.i.d.) samples from 0.0 to 1.0.

Input Parameters: No input arguments.

Output TypeNumber Column
Configuration ParametersNo
ReturnsReturns the generated column.
ThrowsApplication Exception

Example:

rand() will return a new column with independent and identically distributed (i.i.d.) samples from 0.0 to 1.0.


Rand_with_seed

Generate a random column with independent and identically distributed (i.i.d.) samples from 0.0 to 1.0.

Input Parameters: long arg0

  • arg0 (required) - The seed
Output TypeNumber Column
Configuration ParametersNo
ReturnsReturns the generated column.
ThrowsApplication Exception

Use Case:

rand_with_seed

Example:

rand_with_seed(2) will return a new column with independent and identically distributed (i.i.d.) samples from 0.0 to 1.0.


Randn

Generate a column with independent and identically distributed (i.i.d.) samples from the standard normal distribution.

Input Parameters: No input arguments.

Output TypeNumber Column
Configuration ParametersNo
ReturnsReturns the generated column.
ThrowsApplication Exception

Use Case:

randn

Example:

randn() will return a new column with independent and identically distributed (i.i.d.) samples from the standard normal distribution.


Randn_with_seed

Generate a column with independent and identically distributed (i.i.d.) samples from the standard normal distribution.

Input Parameters: long arg0

  • arg0 (required) - The seed
Output TypeNumber Column
Configuration ParametersNo
ReturnsReturns the generated column.
ThrowsApplication Exception

Use Case:

rand_with_seed

Example:

randn_with_seed(2) will return a new column with independent and identically distributed (i.i.d.) samples from the standard normal distribution.


Rint

Computes the double value that is closest in value to the argument and is equal to a mathematical integer.

Input Parameters: Column arg0

  • arg0 (required) - The column for which double value to be calculated.
Output TypeNumber Column
Configuration ParametersNo
ReturnsReturns the computed last day.
ThrowsApplication Exception

Use Case:

rint2

Example:

rint(80.89) will return 81.0


Round

Computes the value of the column arg0 rounded to 0 decimal places.

Input Parameters: Column arg0

arg0 (required) - The column for which value rounded to 0 decimal places to be calculated.

Output TypeNumber Column
Configuration ParametersNo
ReturnsReturns the computed value.
ThrowsApplication Exception

Use Case:

round_column

Example:

round(80.89) will return 81.0


Round_with_scale

Computes the value of arg0 to scale decimal places if arg1 is greater than or equal to 0 or at integral part when arg1 is less than 0.

Input Parameters: Column arg0, int arg1

  • arg0 (required) - The column for which value rounded to 0 decimal places to be calculated.

  • arg0 (required) - The seed

Output TypeNumber Column
Configuration ParametersNo
ReturnsReturns the computed value.
ThrowsApplication Exception

Use Case:

round-with_scale

Example:

round_with_scale(80.89,1) will return 80.9


Signum

Computes the signum of the given value.

Input Parameters: Column arg0

  • arg0 (required) - The column for which signum to be calculated.
Output TypeNumber Column
Configuration ParametersNo
ReturnsReturns the computed signum.
ThrowsApplication Exception

Example:

signum(20) will return 1.0


Sin

Computes the sine of the given value.

Input Parameters: Column arg0

  • arg0 (required) - The column for which sine to be calculated.
Output TypeNumber Column
Configuration ParametersNo
ReturnsReturns the computed sine
ThrowsApplication Exception

Example:

sin(20) will return 0.9129452507276277


Sinh

Computes the hyperbolic sine of the given value.

Input Parameters: Column arg0

  • arg0 (required) - The column for which sine to be calculated.
Output TypeNumber Column
Configuration ParametersNo
ReturnsReturns the computed hyperbolic sine.
ThrowsApplication Exception

Example:

sinh(20) will return 2.4258259770489514E8


SqlSqrt

Computes the square root of the specified float value.

Input Parameters: Column arg0

  • arg0 (required) - The column for which square root to be calculated.
Output TypeNumber Column
Configuration ParametersNo
ReturnsReturns the computed square root.
ThrowsApplication Exception

Use Case:

sqlrt

Example:

sqlSqrt(20) will return 4.47213595499958


Tan

Computes the tangent of the given value.

Input Parameters: Column arg0

arg0 (required) - The column for which tangent to be calculated.

Output TypeNumber Column
Configuration ParametersNo
ReturnsReturns the computed tangent
ThrowsApplication Exception

Use Case:

tan

Example:

tan(20) will return 2.237160944224742


Tanh

Computes the hyperbolic tangent of the given value.

Input Parameters: Column arg0

  • arg0 (required) - The column for which hyperbolic tangent to be calculated.
Output TypeNumber Column
Configuration ParametersNo
ReturnsReturns the computed hyperbolic tangent.
ThrowsApplication Exception

Example:

tanh(20) will return 1.0


ToDegrees

Computes the angle measured in radians to an approximately equivalent angle measured in degrees.

Input Parameters: Column arg0

  • arg0 (required) - The column for which degree to be calculated
Output TypeNumber Column
Configuration ParametersNo
ReturnsReturns the angle measured in degrees.
ThrowsApplication Exception

Use Case:

todgereess

Example:

toDegrees(3.14159) will return 180


ToRadians

Computes the angle measured in degrees to an approximately equivalent angle measured in radians.

Input Parameters: Column arg0

  • arg0 (required) - A column for which radians to be calculated.
Output TypeNumber Column
Configuration ParametersNo
ReturnsReturns the angle measured in radians.
ThrowsApplication Exception

Example:

toRadians(180) will return 3.14159

Top