Numeric Functions
42 functions covering rounding, trigonometry, logarithms, random number generation, and bitwise operations. The source column is always the implicit first input.
| Function | Syntax | Parameters | Notes |
|---|---|---|---|
round | round(column, places, mode) | places default 2. mode — HALF_UP / UP / DOWN. | |
abs | abs(column) | None. | |
negate | negate(column) | None. | |
ceil | ceil(column) | None. | |
floor | floor(column) | None. | |
mod | mod(column, divisor) | divisor default 2. | |
power | power(column, exponent) | exponent default 2. | |
sqrt | sqrt(column) | None. | |
bround | bround(column, places) | places default 2. | Banker's rounding (round-half-to-even). |
sign | sign(column) | None. | |
cbrt | cbrt(column) | None. | Cube root. |
hypot | hypot(column, otherColumn) | otherColumn — column ref. | sqrt(column² + otherColumn²). |
trunc_number | trunc_number(column, places) | places default 0. | Truncates without rounding. |
exp | exp(column) | None. | |
ln | ln(column) | None. | Natural log. |
log | log(column, base) | base default 10. | |
log10 | log10(column) | None. | |
pi | pi() | None. | Constant, ignores source column. |
random_number | random_number(seed) | seed optional. | Uniform distribution. |
randn | randn(seed) | seed optional. | Standard normal distribution. |
greatest | greatest(column, values[]) | values — array of operands. | |
least | least(column, values[]) | values — array of operands. | |
sin / cos / tan / asin / acos / atan / sinh / cosh / tanh / degrees / radians | sin(column) etc. | None. | Standard trigonometric functions; radians in, radians out except degrees/radians which convert. |
atan2 | atan2(column, otherColumn) | otherColumn — column ref. | |
width_bucket | width_bucket(column, minValue, maxValue, bucketCount) | minValue default 0, maxValue default 100, bucketCount default 10. | Assigns column value to an equal-width histogram bucket. |
factorial | factorial(column) | None. | |
isfinite | isfinite(column) | None. | Returns boolean; false for NaN/Infinity. |
bit_and / bit_or / bit_xor | bit_and(column, operand) | operand — column or literal integer. | |
shift_left | shift_left(column, bits) | bits default 1. | |
shift_right | shift_right(column, bits) | bits default 1. |