functions_arithmetic.yaml¶
This document file is generated for functions_arithmetic.yaml
Scalar Functions¶
add¶
Implementations:
add(x
, y
, option:overflow
): -> return_type
0. add(i8
, i8
, option:overflow
): -> i8
1. add(i16
, i16
, option:overflow
): -> i16
2. add(i32
, i32
, option:overflow
): -> i32
3. add(i64
, i64
, option:overflow
): -> i64
4. add(fp32
, fp32
, option:rounding
): -> fp32
5. add(fp64
, fp64
, option:rounding
): -> fp64
Add two values.
Options:
subtract¶
Implementations:
subtract(x
, y
, option:overflow
): -> return_type
0. subtract(i8
, i8
, option:overflow
): -> i8
1. subtract(i16
, i16
, option:overflow
): -> i16
2. subtract(i32
, i32
, option:overflow
): -> i32
3. subtract(i64
, i64
, option:overflow
): -> i64
4. subtract(fp32
, fp32
, option:rounding
): -> fp32
5. subtract(fp64
, fp64
, option:rounding
): -> fp64
Subtract one value from another.
Options:
multiply¶
Implementations:
multiply(x
, y
, option:overflow
): -> return_type
0. multiply(i8
, i8
, option:overflow
): -> i8
1. multiply(i16
, i16
, option:overflow
): -> i16
2. multiply(i32
, i32
, option:overflow
): -> i32
3. multiply(i64
, i64
, option:overflow
): -> i64
4. multiply(fp32
, fp32
, option:rounding
): -> fp32
5. multiply(fp64
, fp64
, option:rounding
): -> fp64
Multiply two values.
Options:
divide¶
Implementations:
divide(x
, y
, option:overflow
): -> return_type
0. divide(i8
, i8
, option:overflow
): -> i8
1. divide(i16
, i16
, option:overflow
): -> i16
2. divide(i32
, i32
, option:overflow
): -> i32
3. divide(i64
, i64
, option:overflow
): -> i64
4. divide(fp32
, fp32
, option:rounding
, option:on_domain_error
, option:on_division_by_zero
): -> fp32
5. divide(fp64
, fp64
, option:rounding
, option:on_domain_error
, option:on_division_by_zero
): -> fp64
*Divide x by y. In the case of integer division, partial values are truncated (i.e. rounded towards 0). The on_division_by_zero
option governs behavior in cases where y is 0 and x is not 0. LIMIT
means positive or negative infinity (depending on the sign of x and y). If x and y are both 0 or both ±infinity, behavior will be governed by on_domain_error
. *
Options:
negate¶
Implementations:
negate(x
, option:overflow
): -> return_type
0. negate(i8
, option:overflow
): -> i8
1. negate(i16
, option:overflow
): -> i16
2. negate(i32
, option:overflow
): -> i32
3. negate(i64
, option:overflow
): -> i64
4. negate(fp32
): -> fp32
5. negate(fp64
): -> fp64
Negation of the value
Options:
modulus¶
Implementations:
modulus(x
, y
): -> return_type
0. modulus(i8
, i8
): -> i8
1. modulus(i16
, i16
): -> i16
2. modulus(i32
, i32
): -> i32
3. modulus(i64
, i64
): -> i64
Get the remainder when dividing one value by another.
power¶
Implementations:
power(x
, y
, option:overflow
): -> return_type
0. power(i64
, i64
, option:overflow
): -> i64
1. power(fp32
, fp32
): -> fp32
2. power(fp64
, fp64
): -> fp64
Take the power with x as the base and y as exponent.
Options:
sqrt¶
Implementations:
sqrt(x
, option:rounding
, option:on_domain_error
): -> return_type
0. sqrt(i64
, option:rounding
, option:on_domain_error
): -> fp64
1. sqrt(fp32
, option:rounding
, option:on_domain_error
): -> fp32
2. sqrt(fp64
, option:rounding
, option:on_domain_error
): -> fp64
Square root of the value
Options:
exp¶
Implementations:
exp(x
, option:rounding
): -> return_type
0. exp(fp32
, option:rounding
): -> fp32
1. exp(fp64
, option:rounding
): -> fp64
The mathematical constant e, raised to the power of the value.
Options:
cos¶
Implementations:
cos(x
, option:rounding
): -> return_type
0. cos(fp32
, option:rounding
): -> fp64
1. cos(fp64
, option:rounding
): -> fp64
Get the cosine of a value in radians.
Options:
sin¶
Implementations:
sin(x
, option:rounding
): -> return_type
0. sin(fp32
, option:rounding
): -> fp64
1. sin(fp64
, option:rounding
): -> fp64
Get the sine of a value in radians.
Options:
tan¶
Implementations:
tan(x
, option:rounding
): -> return_type
0. tan(fp32
, option:rounding
): -> fp64
1. tan(fp64
, option:rounding
): -> fp64
Get the tangent of a value in radians.
Options:
cosh¶
Implementations:
cosh(x
, option:rounding
): -> return_type
0. cosh(fp32
, option:rounding
): -> fp32
1. cosh(fp64
, option:rounding
): -> fp64
Get the hyperbolic cosine of a value in radians.
Options:
sinh¶
Implementations:
sinh(x
, option:rounding
): -> return_type
0. sinh(fp32
, option:rounding
): -> fp32
1. sinh(fp64
, option:rounding
): -> fp64
Get the hyperbolic sine of a value in radians.
Options:
tanh¶
Implementations:
tanh(x
, option:rounding
): -> return_type
0. tanh(fp32
, option:rounding
): -> fp32
1. tanh(fp64
, option:rounding
): -> fp64
Get the hyperbolic tangent of a value in radians.
Options:
acos¶
Implementations:
acos(x
, option:rounding
, option:on_domain_error
): -> return_type
0. acos(fp32
, option:rounding
, option:on_domain_error
): -> fp64
1. acos(fp64
, option:rounding
, option:on_domain_error
): -> fp64
Get the arccosine of a value in radians.
Options:
asin¶
Implementations:
asin(x
, option:rounding
, option:on_domain_error
): -> return_type
0. asin(fp32
, option:rounding
, option:on_domain_error
): -> fp64
1. asin(fp64
, option:rounding
, option:on_domain_error
): -> fp64
Get the arcsine of a value in radians.
Options:
atan¶
Implementations:
atan(x
, option:rounding
): -> return_type
0. atan(fp32
, option:rounding
): -> fp64
1. atan(fp64
, option:rounding
): -> fp64
Get the arctangent of a value in radians.
Options:
acosh¶
Implementations:
acosh(x
, option:rounding
, option:on_domain_error
): -> return_type
0. acosh(fp32
, option:rounding
, option:on_domain_error
): -> fp32
1. acosh(fp64
, option:rounding
, option:on_domain_error
): -> fp64
Get the hyperbolic arccosine of a value in radians.
Options:
asinh¶
Implementations:
asinh(x
, option:rounding
): -> return_type
0. asinh(fp32
, option:rounding
): -> fp32
1. asinh(fp64
, option:rounding
): -> fp64
Get the hyperbolic arcsine of a value in radians.
Options:
atanh¶
Implementations:
atanh(x
, option:rounding
, option:on_domain_error
): -> return_type
0. atanh(fp32
, option:rounding
, option:on_domain_error
): -> fp32
1. atanh(fp64
, option:rounding
, option:on_domain_error
): -> fp64
Get the hyperbolic arctangent of a value in radians.
Options:
atan2¶
Implementations:
atan2(x
, y
, option:rounding
, option:on_domain_error
): -> return_type
0. atan2(fp32
, fp32
, option:rounding
, option:on_domain_error
): -> fp64
1. atan2(fp64
, fp64
, option:rounding
, option:on_domain_error
): -> fp64
Get the arctangent of values given as x/y pairs.
Options:
abs¶
Implementations:
abs(x
, option:overflow
): -> return_type
0. abs(i8
, option:overflow
): -> i8
1. abs(i16
, option:overflow
): -> i16
2. abs(i32
, option:overflow
): -> i32
3. abs(i64
, option:overflow
): -> i64
4. abs(fp32
): -> fp32
5. abs(fp64
): -> fp64
*Calculate the absolute value of the argument. Integer values allow the specification of overflow behavior to handle the unevenness of the twos complement, e.g. Int8 range [-128 : 127]. *
Options:
sign¶
Implementations:
sign(x
): -> return_type
0. sign(i8
): -> i8
1. sign(i16
): -> i16
2. sign(i32
): -> i32
3. sign(i64
): -> i64
4. sign(fp32
): -> fp32
5. sign(fp64
): -> fp64
*Return the signedness of the argument. Integer values return signedness with the same type as the input. Possible return values are [-1, 0, 1] Floating point values return signedness with the same type as the input. Possible return values are [-1.0, -0.0, 0.0, 1.0, NaN] *
factorial¶
Implementations:
factorial(n
, option:overflow
): -> return_type
0. factorial(i32
, option:overflow
): -> i32
1. factorial(i64
, option:overflow
): -> i64
*Return the factorial of a given integer input. The factorial of 0! is 1 by convention. Negative inputs will raise an error. *
Options:
bitwise_not¶
Implementations:
bitwise_not(x
): -> return_type
0. bitwise_not(i8
): -> i8
1. bitwise_not(i16
): -> i16
2. bitwise_not(i32
): -> i32
3. bitwise_not(i64
): -> i64
*Return the bitwise NOT result for one integer input. *
bitwise_and¶
Implementations:
bitwise_and(x
, y
): -> return_type
0. bitwise_and(i8
, i8
): -> i8
1. bitwise_and(i16
, i16
): -> i16
2. bitwise_and(i32
, i32
): -> i32
3. bitwise_and(i64
, i64
): -> i64
*Return the bitwise AND result for two integer inputs. *
bitwise_or¶
Implementations:
bitwise_or(x
, y
): -> return_type
0. bitwise_or(i8
, i8
): -> i8
1. bitwise_or(i16
, i16
): -> i16
2. bitwise_or(i32
, i32
): -> i32
3. bitwise_or(i64
, i64
): -> i64
*Return the bitwise OR result for two given integer inputs. *
bitwise_xor¶
Implementations:
bitwise_xor(x
, y
): -> return_type
0. bitwise_xor(i8
, i8
): -> i8
1. bitwise_xor(i16
, i16
): -> i16
2. bitwise_xor(i32
, i32
): -> i32
3. bitwise_xor(i64
, i64
): -> i64
*Return the bitwise XOR result for two integer inputs. *
Aggregate Functions¶
sum¶
Implementations:
sum(x
, option:overflow
): -> return_type
0. sum(i8
, option:overflow
): -> i64?
1. sum(i16
, option:overflow
): -> i64?
2. sum(i32
, option:overflow
): -> i64?
3. sum(i64
, option:overflow
): -> i64?
4. sum(fp32
, option:overflow
): -> fp64?
5. sum(fp64
, option:overflow
): -> fp64?
Sum a set of values. The sum of zero elements yields null.
Options:
sum0¶
Implementations:
sum0(x
, option:overflow
): -> return_type
0. sum0(i8
, option:overflow
): -> i64
1. sum0(i16
, option:overflow
): -> i64
2. sum0(i32
, option:overflow
): -> i64
3. sum0(i64
, option:overflow
): -> i64
4. sum0(fp32
, option:overflow
): -> fp64
5. sum0(fp64
, option:overflow
): -> fp64
*Sum a set of values. The sum of zero elements yields zero. Null values are ignored. *
Options:
avg¶
Implementations:
avg(x
, option:overflow
): -> return_type
0. avg(i8
, option:overflow
): -> i8?
1. avg(i16
, option:overflow
): -> i16?
2. avg(i32
, option:overflow
): -> i32?
3. avg(i64
, option:overflow
): -> i64?
4. avg(fp32
, option:overflow
): -> fp32?
5. avg(fp64
, option:overflow
): -> fp64?
Average a set of values. For integral types, this truncates partial values.
Options:
min¶
Implementations:
min(x
): -> return_type
0. min(i8
): -> i8?
1. min(i16
): -> i16?
2. min(i32
): -> i32?
3. min(i64
): -> i64?
4. min(fp32
): -> fp32?
5. min(fp64
): -> fp64?
Min a set of values.
max¶
Implementations:
max(x
): -> return_type
0. max(i8
): -> i8?
1. max(i16
): -> i16?
2. max(i32
): -> i32?
3. max(i64
): -> i64?
4. max(fp32
): -> fp32?
5. max(fp64
): -> fp64?
Max a set of values.
product¶
Implementations:
product(x
, option:overflow
): -> return_type
0. product(i8
, option:overflow
): -> i8
1. product(i16
, option:overflow
): -> i16
2. product(i32
, option:overflow
): -> i32
3. product(i64
, option:overflow
): -> i64
4. product(fp32
, option:rounding
): -> fp32
5. product(fp64
, option:rounding
): -> fp64
Product of a set of values. Returns 1 for empty input.
Options:
std_dev¶
Implementations:
std_dev(x
, option:rounding
, option:distribution
): -> return_type
0. std_dev(fp32
, option:rounding
, option:distribution
): -> fp32?
1. std_dev(fp64
, option:rounding
, option:distribution
): -> fp64?
Calculates standard-deviation for a set of values.
Options:
variance¶
Implementations:
variance(x
, option:rounding
, option:distribution
): -> return_type
0. variance(fp32
, option:rounding
, option:distribution
): -> fp32?
1. variance(fp64
, option:rounding
, option:distribution
): -> fp64?
Calculates variance for a set of values.
Options:
corr¶
Implementations:
corr(x
, y
, option:rounding
): -> return_type
0. corr(fp32
, fp32
, option:rounding
): -> fp32?
1. corr(fp64
, fp64
, option:rounding
): -> fp64?
*Calculates the value of Pearson’s correlation coefficient between x
and y
. If there is no input, null is returned. *
Options:
mode¶
Implementations:
mode(x
): -> return_type
0. mode(i8
): -> i8?
1. mode(i16
): -> i16?
2. mode(i32
): -> i32?
3. mode(i64
): -> i64?
4. mode(fp32
): -> fp32?
5. mode(fp64
): -> fp64?
*Calculates mode for a set of values. If there is no input, null is returned. *
median¶
Implementations:
median(precision
, x
, option:rounding
): -> return_type
0. median(precision
, i8
, option:rounding
): -> i8?
1. median(precision
, i16
, option:rounding
): -> i16?
2. median(precision
, i32
, option:rounding
): -> i32?
3. median(precision
, i64
, option:rounding
): -> i64?
4. median(precision
, fp32
, option:rounding
): -> fp32?
5. median(precision
, fp64
, option:rounding
): -> fp64?
*Calculate the median for a set of values. Returns null if applied to zero records. For the integer implementations, the rounding option determines how the median should be rounded if it ends up midway between two values. For the floating point implementations, they specify the usual floating point rounding mode. *
Options:
quantile¶
Implementations:
quantile(boundaries
, precision
, n
, distribution
, option:rounding
): -> return_type
0. quantile(boundaries
, precision
, i64
, any
, option:rounding
): -> LIST?<any>
*Calculates quantiles for a set of values. This function will divide the aggregated values (passed via the distribution argument) over N equally-sized bins, where N is passed via a constant argument. It will then return the values at the boundaries of these bins in list form. If the input is appropriately sorted, this computes the quantiles of the distribution. The function can optionally return the first and/or last element of the input, as specified by the boundaries
argument. If the input is appropriately sorted, this will thus be the minimum and/or maximum values of the distribution. When the boundaries do not lie exactly on elements of the incoming distribution, the function will interpolate between the two nearby elements. If the interpolated value cannot be represented exactly, the rounding
option controls how the value should be selected or computed. The function fails and returns null in the following cases: - n
is null or less than one; - any value in distribution
is null.
The function returns an empty list if n
equals 1 and boundaries
is set to NEITHER
. *
Options:
Window Functions¶
row_number¶
Implementations:
0. row_number(): -> i64?
the number of the current row within its partition.
rank¶
Implementations:
0. rank(): -> i64?
the rank of the current row, with gaps.
dense_rank¶
Implementations:
0. dense_rank(): -> i64?
the rank of the current row, without gaps.
percent_rank¶
Implementations:
0. percent_rank(): -> fp64?
the relative rank of the current row.
cume_dist¶
Implementations:
0. cume_dist(): -> fp64?
the cumulative distribution.
ntile¶
Implementations:
ntile(x
): -> return_type
0. ntile(i32
): -> i32?
1. ntile(i64
): -> i64?
Return an integer ranging from 1 to the argument value,dividing the partition as equally as possible.