OPAL Numeric Functions

Numeric functions act on and/or produce numeric values, for your mathematical calculation needs.

Function

Description

abs

Returns the absolute value of ‘val’.

arccos_deg

Computes the arc cosine of the input.

arccos_rad

Computes the arc cosine of the input.

arcsin_deg

Computes the arc sine of the input.

arcsin_rad

Computes the arc sine of the input.

arctan_deg

Computes the arc tangent of the input.

arctan_rad

Computes the arc tangent of the input.

avg

Calculate the arithmetic average of the input expression across the group, or of the scalar arguments if more than one.

ceil

Returns ‘val’ rounded up to the given ‘precision’.

cos_deg

Computes the cosine of the input and returns a float64.

cos_rad

Computes the cosine of the input and returns a float64.

count

Count the number of non-null items in the group.

degrees

Converts from radians to degrees.

delta

Calculates the value difference of the argument in each time bin for each group.

delta_monotonic

Calculates the amount of difference in a column in each time bin for each group.

dense_rank

Returns the dense rank within an ordered group of values.

deriv

Calculate the average per-second derivative of the argument across the group.

exp

Returns Euler’s number e raised to the given number.

float64_null

Returns a null value of type float64.

floor

Returns ‘val’ rounded down to the given ‘precision’.

haversine_distance_km

Computes the great circle approximate distance between two latitude/longitude coordinates, using the haversine formula.

int64_null

Returns a null value of type int64.

int_div

Returns the integer quotient of the dividend divided by the divisor and truncates the remainder.

ln

Returns natural logarithm of a numeric expression.

log

Returns logarithm of a numeric expression (second argument) with the provided base (first argument).

median

Return the fast approximate median value of one column.

median_exact

Return the exact median value of one column.

mod

Returns the remainder when dividend is divided by the divisor.

percentile

Returns an approximated value for the specified percentile of the input expression across the group.

percentile_cont

Assuming a continuous distribution, return the value for the specified percentile of the input expression across the group.

percentile_disc

Assuming a discrete distribution, return the value for the specified percentile of the input expression across the group.

pi

Returns the value of pi as a float64.

pow

Returns a number ‘base’ raised to the specified power ‘exponent’.

prom_quantile

Calculates an approximate percentile value of the distribution in a histogram metric generated by a Prometheus data source.

radians

Converts from degrees to radians.

rank

Returns the rank within an ordered group of values.

rate

Calculate the average per-second rate of the argument across the group.

round

Returns ‘val’ rounded to the given ‘precision’.

row_number

Return the window index of the row within its groupby, when ordered by the orderby.

sin_deg

Computes the sine of the input and returns a float64.

sin_rad

Computes the sine of the input and returns a float64.

sqrt

Returns the square root for a given input and null if input is negative.

stddev

Calculate the standard deviation across the group.

sum

Calculate the sum of the argument across the group, or of the scalar arguments if more than one.

tan_deg

Computes the tangent of the input and returns a float64.

tan_rad

Computes the tangent of the input and returns a float64.

uniform

Generates a uniformly-distributed pseudo-random number in the inclusive range [min, max].

width_bucket

Construct equi-width histogram by dividing up the range between min and max with num_buckets buckets, and compute an integer

zipf

Returns a Zipf-distributed integer, for N elements and characteristic exponent s.