Functions
97 pages
- add a + b, checked (OVERFLOW).
- sub a - b, checked.
- mul a × b, checked.
-
add_wrappinga + b on Int64, wrapping on overflow. -
sub_wrappinga - b on Int64, wrapping on overflow. -
mul_wrappinga × b on Int64, wrapping on overflow. - div a / b on decimals (options scale, mode) or doubles; Int64 / Int64 is refused (use div_trunc, div_floor or a cast).
-
div_truncInt64 quotient rounded toward zero; DIVISION_BY_ZERO on 0. -
div_floorInt64 quotient rounded toward negative infinity. - rem Int64 remainder of div_trunc (the sign of a).
- neg -a, checked.
- abs |a|, checked.
- eq a = b; null when either is null.
- ne a ≠ b.
- lt a < b (NaN after every number).
- le a ≤ b.
- gt a > b.
- ge a ≥ b.
-
is_distinct_froma ≠ b with null equal to null; never null. -
is_not_distinct_froma = b with null equal to null; never null. -
is_nullWhether a is null (NaN is not null). -
is_not_nullWhether a is not null. -
is_nanWhether a Float64 is NaN. - and a and b; null when either is null.
- or a or b; null when either is null.
- not not a.
-
and_kleeneKleene and: false and null is false. -
or_kleeneKleene or: true or null is true. - coalesce The first argument that is not null.
-
if_elseb when the condition is true, else c (a null condition takes c). - cast a as the type of option to, checked; option mode rounds (default half_to_even); option on_error is "error" (default) or "null".
- round A decimal at option scale (default 0) with option mode (default half_to_even).
- sqrt The IEEE square root of a Float64.
- exp e^a (hint_math).
- ln The natural logarithm (hint_math).
-
ln_1pln(1 + a) (hint_math). - expm1 e^a - 1 (hint_math).
- sin The sine (hint_math).
- cos The cosine (hint_math).
- erf The error function (hint_math).
- lgamma ln|Γ(a)| (hint_math).
- pow a^b on Float64 (hint_math).
- atan2 The angle of (b, a): atan2(y = a, x = b) (hint_math).
- length The number of Unicode scalar values of a string.
-
byte_lengthThe number of UTF-8 bytes of a string. - lower Unicode lowercase (the Unicode version of the pinned toolchain).
- upper Unicode uppercase.
- trim Without leading and trailing Unicode white space.
-
starts_withWhether a starts with b (bytewise). -
ends_withWhether a ends with b. - contains Whether b occurs in a.
-
regex_matchWhether option pattern (hint-core's linear-time regex subset; ASCII \d \w \s) occurs anywhere in a, as Python's re.search. -
approx_containsWhether a may be in the Bloom filter b (a sketch value, Binary, of a's type): never false for a value added, true for another at the filter's false-positive rate. - concat The strings joined; null when any is null.
- replace a with every occurrence of b replaced by c, left to right; an empty b leaves a as it is.
- split a cut at every occurrence of b, as a list; an empty b gives the characters.
- substring Options start (from 1) and length, in Unicode scalar values.
- year The year of a Date, a LocalTimestamp, or a Timestamp in UTC.
- month The month, 1 to 12.
- day The day of the month.
- hour The hour, 0 to 23 (Timestamp in UTC).
- minute The minute.
- second The second.
- weekday The ISO weekday, 1 (Monday) to 7 (Sunday).
- quarter The quarter, 1 to 4.
-
day_of_yearThe day of the year, from 1. -
date_truncA Date or timestamp truncated to option unit: year, quarter, month, week (ISO, Monday), day, hour, minute or second; a Timestamp in UTC. -
add_monthsA Date or timestamp moved by b calendar months, the day clamped to the month's last (Jan 31 + 1 is Feb 28 or 29); a Timestamp in UTC. -
assume_timezoneA wall-clock time read in option zone (IANA), as an instant; options ambiguous (earlier, later, error) and nonexistent (shift_forward, shift_backward, error), both error by default. -
to_localAn instant as the wall-clock time of option zone (default: the column's zone). - count The number of non-null values.
-
count_allThe number of rows. -
count_distinctThe number of distinct non-null values (keys as the sort order sees them: -0 = +0, one NaN). - mode The most frequent non-null value; a tie takes the least.
- median quantile with q 0.5, method cont.
- quantile The exact quantile at option q (0 to 1): method cont (default) interpolates linearly at (n - 1)q (a decimal exactly, rounded half to even), disc takes the first value whose cumulative share reaches q (position ceil(nq) - 1).
- sum The sum; Float64 pairwise over fixed blocks, exact for Int64 and decimals (Decimal128(38, s)).
- fsum A compensated Float64 sum.
- mean The mean: Float64 for Int64 and Float64, Decimal128(38, max(s, 6)) for decimals.
- min The least value (the sort order of conventions.md).
- max The greatest value.
-
var_sampThe sample variance of Float64 values. -
stddev_sampThe sample standard deviation. - first The first value by the measure's order_by (nulls included).
- last The last value by the measure's order_by.
- list Every value, in the measure's order_by.
-
string_aggThe strings joined by option sep (default ","), in the measure's order_by. -
approx_count_distinctThe number of distinct non-null values from a HyperLogLog sketch (options lg_k 4 to 21, default 12; seed, default 0; confidence 1, 2 or 3 standard deviations, default 2): {estimate, lower, upper} as Float64, error kind relative_value. -
approx_quantileThe value at rank option q (0 to 1) from a KLL sketch (option k, default 200; seed, required; confidence, default 2): {estimate, lower, upper} of the argument's type, values from the column, error kind rank. -
approx_frequentThe heaviest values from a Misra–Gries sketch (option max_map_size, a power of 2, default 64; rule no_false_positives, the default, or no_false_negatives): a list of {item, estimate, lower, upper}, heaviest first, error kind absolute_weight. -
bool_andWhether every non-null value is true. -
bool_orWhether any non-null value is true. -
row_numberThe row's position in its ordered partition, from 1. - rank The rank with gaps for ties.
-
dense_rankThe rank without gaps. - lag The value option offset rows earlier (default 1).
- lead The value option offset rows later (default 1).