Chalk SQL Reference

This reference documents the complete set of Chalk SQL functions for federated queries across data sources, offline stores, and the Chalk catalog.

Returns the absolute value of a number.
Examples
SELECT abs(-42);
| abs(-42) |
| -------- |
| 42       |
Overloads
Calculates the inverse cosine in radians.
Parameters
x:
double
The input value.
Calculates the inverse hyperbolic cosine.
Parameters
x:
double
The input value.
Calculates the inverse hyperbolic sine.
Parameters
x:
double
The input value.
Calculates the inverse hyperbolic tangent.
Parameters
x:
double
The input value.
Calculates the inverse sine in radians.
Parameters
x:
double
The input value.
Calculates the arctangent of a number in radians.
Parameters
x:
double
The input value.
Calculates the arctangent of y/x in radians, handling quadrant correctly.
Parameters
y:
double
The second input value.
x:
double
The input value.
Rounds a number using banker's rounding, optionally to a specified number of decimal places.
Examples
SELECT bankers_round(2.5);
| bankers_round(2.5) |
| ------------------ |
| 2.0                |
SELECT bankers_round(42.125, 2);
| bankers_round(42.125, 2) |
| ------------------------ |
| 42.12                    |
Calculates the cube root of a number.
Examples
SELECT cbrt(27);
| cbrt(27) |
| -------- |
| 3.0      |
Overloads
Alias for ceiling.
Examples
SELECT ceil(42.1);
| ceil(42.1) |
| ---------- |
| 43.0       |
Returns the smallest integer greater than or equal to the given number.
Examples
SELECT ceiling(42.1);
| ceiling(42.1) |
| ------------- |
| 43.0          |
Constrains a value to a minimum and maximum range.
Examples
SELECT clamp(12, 0, 10);
| clamp(12, 0, 10) |
| ---------------- |
| 10               |
Calculates the cosine of an angle in radians.
Parameters
x:
double
The input value.
Calculates the hyperbolic cosine of a number.
Parameters
x:
double
The input value.
Calculates the cotangent of an angle in radians.
Parameters
x:
double
The input value.
Converts radians to degrees.
Parameters
x:
double
The input value.
Examples
SELECT degrees(pi());
| degrees(pi()) |
| ------------- |
| 180.0         |
Returns the mathematical constant e (Euler's number).
Parameters
None
Calculates e raised to the power of a number.
Parameters
x:
double
The input value.
Returns the largest integer less than or equal to the given number.
Examples
SELECT floor(42.9);
| floor(42.9) |
| ----------- |
| 42.0        |
Overloads
Checks if a floating-point number is finite (not NaN or infinite).
Parameters
x:
double
The input value.
Checks if a floating-point number is infinite.
Parameters
x:
double
The input value.
Checks if a floating-point number is NaN (Not a Number).
Parameters
x:
double
The input value.
Calculates the natural logarithm of a number.
Parameters
x:
double
The input value.
Calculates the logarithm of a number with a specified or default base.
Examples
SELECT log(10, 100);
| log(10, 100) |
| ------------ |
| 2.0          |
Overloads
Calculates the base-10 logarithm of a number.
Parameters
x:
double
The input value.
Calculates the natural logarithm of (1 + x), accurate for small x.
Parameters
x:
double
The input value.
Calculates the base-2 logarithm of a number.
Parameters
x:
double
The input value.
Returns a floating point NaN (Not a Number) value.
Parameters
None
Returns the negative value of a number.
Overloads
Returns the mathematical constant π (pi).
Parameters
None
Raises a number to the power of another number.
Parameters
x:
double
The input value.
p:
double
The p argument.
Examples
SELECT pow(2.0, 8.0);
| pow(2.0, 8.0) |
| ------------- |
| 256.0         |
Raises the first number to the power of the second number.
Parameters
x:
double
The input value.
p:
double
The p argument.
Examples
SELECT power(2.0, 8.0);
| power(2.0, 8.0) |
| --------------- |
| 256.0           |
Converts degrees to radians.
Parameters
x:
double
The input value.
Examples
SELECT radians(180.0);
| radians(180.0)    |
| ----------------- |
| 3.141592653589793 |
Generates a random float between 0 and 1.
Parameters
None
Generates a pseudo-random float or integer.
Examples
SELECT random();
| random()                  |
| ------------------------- |
| <random double in [0, 1)> |
Rounds a floating point number, optionally to a specified number of decimal places.
Examples
SELECT round(42.5);
| round(42.5) |
| ----------- |
| 43.0        |
SELECT round(42.125, 2);
| round(42.125, 2) |
| ---------------- |
| 42.13            |
Rounds a number to n significant figures.
Parameters
x:
double
The input value.
y:
int64
The second input value.
Returns the sign of a number as -1, 0, or 1.
Examples
SELECT sign(-42);
| sign(-42) |
| --------- |
| -1        |
Overloads
Calculates the sine of an angle in radians.
Parameters
x:
double
The input value.
Calculates the square root of a number.
Parameters
x:
double
The input value.
Examples
SELECT sqrt(144.0);
| sqrt(144.0) |
| ----------- |
| 12.0        |
Calculates the tangent of an angle in radians.
Parameters
x:
double
The input value.
Calculates the hyperbolic tangent of a number.
Parameters
x:
double
The input value.
Alias for truncate.
Truncates a floating-point number, optionally to a specified number of decimal places.
Examples
SELECT truncate(42.987);
| truncate(42.987) |
| ---------------- |
| 42.0             |
SELECT truncate(42.987, 2);
| truncate(42.987, 2) |
| ------------------- |
| 42.98               |
Returns the remainder after dividing the first value by the second.
Examples
SELECT 7 % 3;
| 7 % 3 |
| ----- |
| 1     |
Overloads
Multiplies numeric values, or scales a duration by a numeric value.
Examples
SELECT 6 * 7;
| 6 * 7 |
| ----- |
| 42    |
Overloads
basic binary ** operation
Parameters
x:
double
The input value.
y:
double
The second input value.
Adds numeric, temporal, or interval values.
Examples
SELECT 2 + 3;
| 2 + 3 |
| ----- |
| 5     |
Overloads
Subtracts numeric, temporal, or interval values.
Examples
SELECT 7 - 3;
| 7 - 3 |
| ----- |
| 4     |
Overloads
Negates a numeric value.
Examples
SELECT -42;
| -42 |
| --- |
| -42 |
Overloads
-x
-x
Divides numeric values, or divides a duration by a numeric value.
Examples
SELECT 7.0 / 2.0;
| 7.0 / 2.0 |
| --------- |
| 3.5       |
Overloads
floor division
Overloads
Alias for pow.
Examples
SELECT pow(2.0, 8.0);
| pow(2.0, 8.0) |
| ------------- |
| 256.0         |
Performs logical AND operation on two boolean values.
Parameters
x:
bool
The input value.
y:
bool
The second input value.
Checks if a value is between two bounds (inclusive).

Type parameters. T_ord can be any orderable type, such as a number, string, date, timestamp, or boolean.

Parameters
x:
$T_ord
The input value. T_ord can be any orderable type, such as a number, string, date, timestamp, or boolean.
min:
$T_ord
The min argument. T_ord can be any orderable type, such as a number, string, date, timestamp, or boolean.
max:
$T_ord
The max argument. T_ord can be any orderable type, such as a number, string, date, timestamp, or boolean.
Returns the first non-null value from a list of arguments.

Type parameters. T means matching inputs and outputs use the same type.

Parameters
x:
$T
The input value. T means matching inputs and outputs use the same type.
y:
$T...
The second input value. T means matching inputs and outputs use the same type.
Examples
SELECT coalesce(NULL, 'fallback');
| coalesce(NULL, 'fallback') |
| -------------------------- |
| fallback                   |
Checks if two values are distinct, treating NULL values as different from non-NULL values.

Type parameters. T means matching inputs and outputs use the same type.

Parameters
x:
$T
The input value. T means matching inputs and outputs use the same type.
y:
$T
The second input value. T means matching inputs and outputs use the same type.
Returns whether two values are equal.

Type parameters. T means matching inputs and outputs use the same type.

Examples
SELECT eq(1, 1);
| eq(1, 1) |
| -------- |
| true     |
Returns whether the first value is greater than the second.

Type parameters. T means matching inputs and outputs use the same type.

Examples
SELECT gt(2, 1);
| gt(2, 1) |
| -------- |
| true     |
Returns whether the first value is greater than or equal to the second.

Type parameters. T means matching inputs and outputs use the same type.

Examples
SELECT gte(2, 2);
| gte(2, 2) |
| --------- |
| true      |
Returns the second argument if the condition is true, otherwise returns the third argument.

Type parameters. T means matching inputs and outputs use the same type.

Parameters
arg1:
bool
The arg1 argument.
The arg2 argument. T means matching inputs and outputs use the same type.
The arg3 argument. T means matching inputs and outputs use the same type.
Checks if the input is null.

Type parameters. T means matching inputs and outputs use the same type.

Parameters
x:
$T
The input value. T means matching inputs and outputs use the same type.
Returns whether the first value is less than the second.

Type parameters. T means matching inputs and outputs use the same type.

Examples
SELECT lt(1, 2);
| lt(1, 2) |
| -------- |
| true     |
Returns whether the first value is less than or equal to the second.

Type parameters. T means matching inputs and outputs use the same type.

Examples
SELECT lte(2, 2);
| lte(2, 2) |
| --------- |
| true      |
Returns whether two values are not equal.

Type parameters. T means matching inputs and outputs use the same type.

Examples
SELECT neq(1, 2);
| neq(1, 2) |
| --------- |
| true      |
Returns NULL if both arguments compare equal; otherwise returns the first argument.

Type parameters. T means matching inputs and outputs use the same type.

Parameters
x:
$T
The input value. T means matching inputs and outputs use the same type.
y:
$T
The second input value. T means matching inputs and outputs use the same type.
Checks if two values are equal, treating NULL values as equal to other NULL values.

Type parameters. T means matching inputs and outputs use the same type.

Parameters
x:
$T
The input value. T means matching inputs and outputs use the same type.
y:
$T
The second input value. T means matching inputs and outputs use the same type.
Checks if two values are not equal, treating NULL values as different from non-NULL values.

Type parameters. T means matching inputs and outputs use the same type.

Parameters
x:
$T
The input value. T means matching inputs and outputs use the same type.
y:
$T
The second input value. T means matching inputs and outputs use the same type.
basic binary != operation

Type parameters. T means matching inputs and outputs use the same type.

Parameters
x:
$T
The input value. T means matching inputs and outputs use the same type.
y:
$T
The second input value. T means matching inputs and outputs use the same type.
basic binary < operation

Type parameters. T_ord can be any orderable type, such as a number, string, date, timestamp, or boolean.

Parameters
x:
$T_ord
The input value. T_ord can be any orderable type, such as a number, string, date, timestamp, or boolean.
y:
$T_ord
The second input value. T_ord can be any orderable type, such as a number, string, date, timestamp, or boolean.
basic binary <= operation

Type parameters. T_ord can be any orderable type, such as a number, string, date, timestamp, or boolean.

Parameters
x:
$T_ord
The input value. T_ord can be any orderable type, such as a number, string, date, timestamp, or boolean.
y:
$T_ord
The second input value. T_ord can be any orderable type, such as a number, string, date, timestamp, or boolean.
basic binary == operation

Type parameters. T means matching inputs and outputs use the same type.

Parameters
x:
$T
The input value. T means matching inputs and outputs use the same type.
y:
$T
The second input value. T means matching inputs and outputs use the same type.
basic binary > operation

Type parameters. T_ord can be any orderable type, such as a number, string, date, timestamp, or boolean.

Parameters
x:
$T_ord
The input value. T_ord can be any orderable type, such as a number, string, date, timestamp, or boolean.
y:
$T_ord
The second input value. T_ord can be any orderable type, such as a number, string, date, timestamp, or boolean.
basic binary >= operation

Type parameters. T_ord can be any orderable type, such as a number, string, date, timestamp, or boolean.

Parameters
x:
$T_ord
The input value. T_ord can be any orderable type, such as a number, string, date, timestamp, or boolean.
y:
$T_ord
The second input value. T_ord can be any orderable type, such as a number, string, date, timestamp, or boolean.
Counts the number of bits in `x`.
Parameters
x:
int64
The input value.
bits:
int64
The bits argument.
Performs bitwise AND operation on two integer values.
Returns the arithmetic right shift operation on x in 2’s complement representation. shift must not be negative.
Parameters
x:
int64
The input value.
shift:
int64
The shift argument.
Returns the logical right shift operation on x (treated as bits-bit integer) shifted by shift. shift must not be negative.
Parameters
x:
int64
The input value.
shift:
int64
The shift argument.
bits:
int64
The bits argument.
Performs bitwise NOT operation (complement) on an integer value.
Performs bitwise OR operation on two integer values.
Returns the left shift operation on x (treated as bits-bit integer) shifted by shift. shift must not be negative.
Parameters
x:
int64
The input value.
shift:
int64
The shift argument.
bits:
int64
The bits argument.
Performs bitwise XOR operation on two integer values.
Applies boolean AND or bitwise AND to two values.
Examples
SELECT TRUE & FALSE;
| TRUE & FALSE |
| ------------ |
| false        |
SELECT 6 & 3;
| 6 & 3 |
| ----- |
| 2     |
Overloads
Applies boolean OR or bitwise OR to two values.
Examples
SELECT TRUE | FALSE;
| TRUE \| FALSE |
| ------------- |
| true          |
SELECT 4 | 1;
| 4 \| 1 |
| ------ |
| 5      |
Overloads
Applies boolean NOT or bitwise NOT to a value.
Examples
SELECT ~TRUE;
| ~TRUE |
| ----- |
| false |
Overloads
~x
~x
~x
~x
~x
~x
Returns true if every element of the array satisfies the predicate.

Type parameters. T means matching inputs and outputs use the same type.

Returns true if any element of the array satisfies the predicate.

Type parameters. T means matching inputs and outputs use the same type.

Returns true if all elements in a boolean array are true.
Returns true if any element in a boolean array is true.
Returns the index of the maximum element in an array.
Returns the index of the minimum element in an array.
Calculates the average of numeric values in an array.
Creates an array from zero or more values.

Type parameters. T means matching inputs and outputs use the same type.

Examples
SELECT array_constructor(1, 2, 3);
| array_constructor(1, 2, 3) |
| -------------------------- |
| [1, 2, 3]                  |
Calculates the cumulative sum of numeric values in an array.
Returns an array with duplicate elements removed, preserving order.

Type parameters. T means matching inputs and outputs use the same type.

Returns an array containing only the duplicate elements from the input array.
Returns elements from the first array that are not present in the second array.

Type parameters. T means matching inputs and outputs use the same type.

Filters an array using a callback function predicate.

Type parameters. T means matching inputs and outputs use the same type.

Parameters
array:
large_list<item: $T>
The input array or list. T means matching inputs and outputs use the same type.
predicate:
($T) => bool
The predicate argument. T means matching inputs and outputs use the same type.
Returns a map of elements to their frequency counts in an array.

Type parameters. T means matching inputs and outputs use the same type.

Parameters
x:
large_list<item: $T>
The input value. T means matching inputs and outputs use the same type.
Checks if an array contains duplicate elements.

Type parameters. T means matching inputs and outputs use the same type.

Returns the intersection of two arrays (elements present in both arrays).

Type parameters. T means matching inputs and outputs use the same type.

Joins array elements into a string using a separator and optional null replacement.

Type parameters. K is the key type of the input map.

Examples
SELECT array_join(array_constructor('a', 'b', 'c'), ',');
| array_join(array_constructor('a', 'b', 'c'), ',') |
| ------------------------------------------------- |
| a,b,c                                             |
Returns the maximum element in an array.

Type parameters. T means matching inputs and outputs use the same type.

Calculates the median value of numeric elements in an array.
Returns the minimum element in an array.

Type parameters. T means matching inputs and outputs use the same type.

Returns the most frequently occurring element in an array.
Examples
SELECT array_mode(array_constructor(1, 2, 2, 3));
| array_mode(array_constructor(1, 2, 2, 3)) |
| ----------------------------------------- |
| 2                                         |
Returns the 1-based position of an element in an array.

Type parameters. T means matching inputs and outputs use the same type.

Examples
SELECT array_position(array_constructor('a', 'b', 'a'), 'a');
| array_position(array_constructor('a', 'b', 'a'), 'a') |
| ----------------------------------------------------- |
| 1                                                     |
Applies a reduce function to each element in an array and returns the accumulated value.

Type parameters. T means matching inputs and outputs use the same type. U is a second generic value type. V is the value type of the input map.

Parameters
array:
large_list<item: $T>
The input array or list. T means matching inputs and outputs use the same type.
The initialState argument. U is a second generic value type.
inputFunction:
($U, $T) => $U
The inputFunction argument. T means matching inputs and outputs use the same type. U is a second generic value type.
outputFunction:
($U) => $V
The outputFunction argument. V is the value type of the input map. U is a second generic value type.
Reduces an array with Python-style loop control. Lambda returns (new_state, control_code, result), where control_code is 0=normal, 1=return, 2=continue, 3=break. Returns row(final_state, control_code, result|null).

Type parameters. T means matching inputs and outputs use the same type. S is the callback state type. R is the callback result type.

Parameters
arg1:
large_list<item: $T>
The arg1 argument. T means matching inputs and outputs use the same type.
The arg2 argument. S is the callback state type.
arg3:
($S, $T) => struct<state: $S, control: int64, result: $R>
The arg3 argument. T means matching inputs and outputs use the same type. R is the callback result type. S is the callback state type.
Removes all occurrences of a specified element from an array.

Type parameters. T means matching inputs and outputs use the same type.

Returns a slice from an array, string, or binary value.

Type parameters. E is the element type of the input array or list.

Examples
SELECT array_slice(array_constructor(1, 2, 3, 4), 2, 3);
| array_slice(array_constructor(1, 2, 3, 4), 2, 3) |
| ------------------------------------------------ |
| [2, 3, 4]                                        |
Sorts an array in ascending order, optionally using a key extraction function.

Type parameters. T means matching inputs and outputs use the same type. U is a second generic value type.

Examples
SELECT array_sort(array_constructor(3, 1, 2));
| array_sort(array_constructor(3, 1, 2)) |
| -------------------------------------- |
| [1, 2, 3]                              |
Sorts an array in descending order, optionally using a key extraction function.

Type parameters. T means matching inputs and outputs use the same type. U is a second generic value type.

Examples
SELECT array_sort_desc(array_constructor(3, 1, 2));
| array_sort_desc(array_constructor(3, 1, 2)) |
| ------------------------------------------- |
| [3, 2, 1]                                   |
Calculates the standard deviation of numeric values in an array.
Calculates the sum of numeric values in an array.
Applies a transformation function to each element in an array and returns a new array.

Type parameters. T means matching inputs and outputs use the same type. U is a second generic value type.

Parameters
array:
large_list<item: $T>
The input array or list. T means matching inputs and outputs use the same type.
function:
($T) => $U
The function argument. T means matching inputs and outputs use the same type. U is a second generic value type.
Checks if two arrays have any elements in common.

Type parameters. T means matching inputs and outputs use the same type.

Returns a list of the distinct elements of the common elements

Type parameters. T means matching inputs and outputs use the same type.

Returns the number of elements in an array or entries in a map.

Type parameters. V is the value type of the input map. K is the key type of the input map.

Examples
SELECT cardinality(array_constructor(1, 2, 3));
| cardinality(array_constructor(1, 2, 3)) |
| --------------------------------------- |
| 3                                       |
Returns all possible combinations of the given size from an array.

Type parameters. T means matching inputs and outputs use the same type.

Checks if a list contains a specific element.

Type parameters. V is the value type of the input map.

Parameters
x:
large_list<item: $V>
The input value. V is the value type of the input map.
The element argument. V is the value type of the input map.
Returns an element from an array or map.

Type parameters. E is the element type of the input array or list. K is the key type of the input map. V is the value type of the input map.

Examples
SELECT element_at(array_constructor('a', 'b'), 2);
| element_at(array_constructor('a', 'b'), 2) |
| ------------------------------------------ |
| b                                          |
Returns the first element in an array that matches the given predicate function.

Type parameters. T means matching inputs and outputs use the same type.

Returns the 1-based index of the first element in an array that matches the given predicate function.

Type parameters. T means matching inputs and outputs use the same type.

Flattens a nested array by one level, combining all sub-arrays into a single array.

Type parameters. T means matching inputs and outputs use the same type.

Returns the largest value from a list of values.

Type parameters. T_ord can be any orderable type, such as a number, string, date, timestamp, or boolean.

Examples
SELECT greatest(3.0, 7.0, 5.0);
| greatest(3.0, 7.0, 5.0) |
| ----------------------- |
| 7.0                     |
SELECT greatest(3, 7, 5);
| greatest(3, 7, 5) |
| ----------------- |
| 7                 |
Returns the smallest value from a list of values.

Type parameters. T_ord can be any orderable type, such as a number, string, date, timestamp, or boolean.

Examples
SELECT least(3.0, 7.0, 5.0);
| least(3.0, 7.0, 5.0) |
| -------------------- |
| 3.0                  |
SELECT least(3, 7, 5);
| least(3, 7, 5) |
| -------------- |
| 3              |
Alias for array_mode.
Examples
SELECT array_mode(array_constructor(1, 2, 2, 3));
| array_mode(array_constructor(1, 2, 2, 3)) |
| ----------------------------------------- |
| 2                                         |
Returns all N-grams (contiguous subsequences of length n) from an array.

Type parameters. T means matching inputs and outputs use the same type.

Returns true if no element of the array satisfies the predicate.

Type parameters. T means matching inputs and outputs use the same type.

Returns the element at the specified Python-style index in a list.

Type parameters. E is the element type of the input array or list.

Creates a range of integers with Python-like semantics.
Combines multiple lists element-wise into a list of paired structures with Python semantics.

Type parameters. E is the element type of the input array or list.

Removes all null values from an array.

Type parameters. T means matching inputs and outputs use the same type.

Returns an array containing the element repeated count times.

Type parameters. E is the element type of the input array or list.

Parameters
The element argument. E is the element type of the input array or list.
count:
int32
The number of values to return or repeat.
Generates a sequence of integers with an optional step.
Examples
SELECT sequence(1, 5);
| sequence(1, 5)  |
| --------------- |
| [1, 2, 3, 4, 5] |
Randomly shuffles the elements of an array.

Type parameters. T means matching inputs and outputs use the same type.

Returns a slice of a list starting at the given position for the specified length.

Type parameters. E is the element type of the input array or list.

Returns the element at the specified 1-based index in the array.

Type parameters. T means matching inputs and outputs use the same type.

Applies a transformation function to each element in an array and returns a new array.

Type parameters. T means matching inputs and outputs use the same type. U is a second generic value type.

Removes the last n elements from the array.

Type parameters. T means matching inputs and outputs use the same type.

Combines two lists element-wise into a list of paired structures.

Type parameters. T means matching inputs and outputs use the same type. U is a second generic value type.

Parameters
array1:
large_list<item: $T>
The array1 argument. T means matching inputs and outputs use the same type.
array2:
large_list<item: $U>
The array2 argument. U is a second generic value type.
Combines two lists element-wise using a callback function to transform paired elements.

Type parameters. T means matching inputs and outputs use the same type. U is a second generic value type. R is the callback result type.

Parameters
array1:
large_list<item: $T>
The array1 argument. T means matching inputs and outputs use the same type.
array2:
large_list<item: $U>
The array2 argument. U is a second generic value type.
function:
($T, $U) => $R
The function argument. T means matching inputs and outputs use the same type. U is a second generic value type. R is the callback result type.
operator alias for list_has_any

Type parameters. E is the element type of the input array or list.

Overloads
Finds all matches of a regular expression pattern in a string and returns them as a list.
Parameters
x:
large_string
The input value.
y:
large_string
The second input value.
Searches for the first occurrence of a pattern in a string using the Boyer-Moore algorithm. Returns the 0-based byte offset of the first match, or -1 if not found.
Parameters
x:
large_string
The input value.
y:
large_string
The second input value.
Converts an integer to its corresponding ASCII character.
Parameters
n:
int64
The count or numeric argument.
Returns the Unicode code point of the only character of the string.
Concatenates two or more strings or lists.

Type parameters. T means matching inputs and outputs use the same type.

Examples
SELECT concat('feature', '_', 'store');
| concat('feature', '_', 'store') |
| ------------------------------- |
| feature_store                   |
Counts the number of non-overlapping regex matches in a string.
Checks if a string ends with a specified suffix.
Parameters
string:
large_string
The input string.
substring:
large_string
The substring to search for.
Examples
SELECT ends_with('feature_store', 'store');
| ends_with('feature_store', 'store') |
| ----------------------------------- |
| true                                |
Returns the Hamming distance of string1 and string2, i.e. the number of positions at which the corresponding characters are different. Note that the two strings must have the same length.
Case-insensitive like
Parameters
x:
large_string
The input value.
y:
large_string
The second input value.
Calculates the Jaccard similarity coefficient between two strings based on character sets.
Parameters
x:
large_string
The input value.
y:
large_string
The second input value.
Calculates the Jaro-Winkler distance between two strings.
Parameters
arg1:
large_string
The arg1 argument.
arg2:
large_string
The arg2 argument.
arg3:
double
The arg3 argument.
Searches for the first occurrence of a pattern in a string using the Knuth-Morris-Pratt algorithm. Returns the 0-based byte offset of the first match, or -1 if not found.
Parameters
x:
large_string
The input value.
y:
large_string
The second input value.
Returns the byte length of a string.
Returns the length of a string, binary, array, or map.

Type parameters. V is the value type of the input map.

Examples
SELECT length('chalk');
| length('chalk') |
| --------------- |
| 5               |
SELECT length(array_constructor(1, 2, 3));
| length(array_constructor(1, 2, 3)) |
| ---------------------------------- |
| 3                                  |
Calculates the Levenshtein distance between two strings.
Parameters
x:
large_string
The input value.
y:
large_string
The second input value.
Checks if a string matches a pattern using SQL LIKE syntax with wildcards.
Parameters
string:
large_string
The input string.
pattern:
large_string
The pattern to match.
Calculates the longest common subsequence between two strings.
Parameters
x:
large_string
The input value.
y:
large_string
The second input value.
Converts a string to lowercase.
Parameters
string:
large_string
The input string.
Examples
SELECT lower('Chalk');
| lower('Chalk') |
| -------------- |
| chalk          |
Left pads a string or binary value to a target length.
Examples
SELECT lpad('42', 5, '0');
| lpad('42', 5, '0') |
| ------------------ |
| 00042              |
Removes whitespace or specified characters from the left side of a string.
Examples
SELECT ltrim('  chalk');
| ltrim('  chalk') |
| ---------------- |
| chalk            |
Render a Jinja2 template using the provided JSON context via minijinja.
Normalizes a string using a Unicode normalization form.
Examples
SELECT normalize('chalk');
| normalize('chalk') |
| ------------------ |
| chalk              |
Returns the byte length of a string or binary value.
Examples
SELECT octet_length('chalk');
| octet_length('chalk') |
| --------------------- |
| 5                     |
Calculates the partial ratio similarity between two strings using fuzzy matching.
Parameters
x:
large_string
The input value.
y:
large_string
The second input value.
Alias for starts_with.
Examples
SELECT starts_with('feature_store', 'feature');
| starts_with('feature_store', 'feature') |
| --------------------------------------- |
| true                                    |
Returns true if all characters in the string are alphanumeric and there is at least one character, matching Python's str.isalnum() behavior.
Returns true if all characters in the string are alphabetic and there is at least one character, matching Python's str.isalpha() behavior.
Returns true if all characters are digit characters and there is at least one character, matching Python's str.isdigit() behavior.
Returns true if all cased characters are lowercase and there is at least one cased character, matching Python's str.islower() behavior.
Returns true if all characters are numeric characters and there is at least one character, matching Python's str.isnumeric() behavior.
Returns true if all characters are whitespace and there is at least one character, matching Python's str.isspace() behavior.
Returns true if the string is titlecased and there is at least one cased character, matching Python's str.istitle() behavior.
Returns true if all cased characters are uppercase and there is at least one cased character, matching Python's str.isupper() behavior.
Strips leading Python whitespace (Unicode-aware), matching Python's str.lstrip() with no arguments.
Removes the prefix from the string if present, matching Python's str.removeprefix().
Removes the suffix from the string if present, matching Python's str.removesuffix().
Strips trailing Python whitespace (Unicode-aware), matching Python's str.rstrip() with no arguments.
Slices a string with exact Python s[start:stop:step] semantics. All integer arguments are nullable (NULL = Python None / unspecified).
Strips leading and trailing Python whitespace (Unicode-aware), matching Python's str.strip() with no arguments.
Returns the first substring matched by a regular expression.
Examples
SELECT regexp_extract('user_123', 'user_([0-9]+)', 1);
| regexp_extract('user_123', 'user_([0-9]+)', 1) |
| ---------------------------------------------- |
| 123                                            |
Returns all substrings matched by a regular expression.
Examples
SELECT regexp_extract_all('a1 b2 c3', '[a-z][0-9]');
| regexp_extract_all('a1 b2 c3', '[a-z][0-9]') |
| -------------------------------------------- |
| [a1, b2, c3]                                 |
Checks if a string matches a regular expression pattern.
Parameters
x:
large_string
The input value.
y:
large_string
The second input value.
Checks if a string matches a regular expression pattern.
Parameters
string:
large_string
The input string.
pattern:
large_string
The pattern to match.
Examples
SELECT regexp_like('user_123', '^user_[0-9]+$');
| regexp_like('user_123', '^user_[0-9]+$') |
| ---------------------------------------- |
| true                                     |
Replaces or removes substrings matched by a regular expression.
Examples
SELECT regexp_replace('user_123', '[0-9]+', '456');
| regexp_replace('user_123', '[0-9]+', '456') |
| ------------------------------------------- |
| user_456                                    |
Splits ``string`` using the regular expression ``pattern`` into a list of strings.
Parameters
string:
large_string
The input string.
pattern:
large_string
The pattern to match.
Replaces or removes occurrences of a substring.
Examples
SELECT replace('hello chalk', 'hello', 'hi');
| replace('hello chalk', 'hello', 'hi') |
| ------------------------------------- |
| hi chalk                              |
Reverses a string, binary value, or array.

Type parameters. T means matching inputs and outputs use the same type.

Examples
SELECT reverse('chalk');
| reverse('chalk') |
| ---------------- |
| klahc            |
Right pads a string or binary value to a target length.
Examples
SELECT rpad('42', 5, '0');
| rpad('42', 5, '0') |
| ------------------ |
| 42000              |
Removes whitespace or specified characters from the right side of a string.
Examples
SELECT rtrim('chalk  ');
| rtrim('chalk  ') |
| ---------------- |
| chalk            |
Computes the similarity ratio between two strings using sequence matching.
Parameters
x:
large_string
The input value.
y:
large_string
The second input value.
Splits a string by a delimiter, optionally limiting the number of splits.
Examples
SELECT split('a,b,c', ',');
| split('a,b,c', ',') |
| ------------------- |
| [a, b, c]           |
Splits a string by delimiter and returns the part at the specified index (1-based).
Parameters
string:
large_string
The input string.
delimiter:
large_string
The delimiter used to split the string.
index:
int64
The index to read.
Examples
SELECT split_part('features.user.id', '.', 2);
| split_part('features.user.id', '.', 2) |
| -------------------------------------- |
| user                                   |
Checks if a string starts with a specified prefix.
Parameters
string:
large_string
The input string.
substring:
large_string
The substring to search for.
Examples
SELECT starts_with('feature_store', 'feature');
| starts_with('feature_store', 'feature') |
| --------------------------------------- |
| true                                    |
Returns the position of a substring within a string.
Examples
SELECT strpos('chalk data', 'data');
| strpos('chalk data', 'data') |
| ---------------------------- |
| 7                            |
Returns the position of the last matching substring within a string.
Examples
SELECT strrpos('chalk data data', 'data');
| strrpos('chalk data data', 'data') |
| ---------------------------------- |
| 12                                 |
Returns a substring starting at the specified position, optionally with a specified length.
Examples
SELECT substr('feature_store', 9);
| substr('feature_store', 9) |
| -------------------------- |
| store                      |
SELECT substr('feature_store', 1, 7);
| substr('feature_store', 1, 7) |
| ----------------------------- |
| feature                       |
Alias for substr.
Examples
SELECT substr('feature_store', 9);
| substr('feature_store', 9) |
| -------------------------- |
| store                      |
SELECT substr('feature_store', 1, 7);
| substr('feature_store', 1, 7) |
| ----------------------------- |
| feature                       |
Converts a string to title case.
Calculates the token set ratio similarity between two strings using fuzzy matching.
Parameters
x:
large_string
The input value.
y:
large_string
The second input value.
Calculates the token sort ratio similarity between two strings using fuzzy matching.
Parameters
x:
large_string
The input value.
y:
large_string
The second input value.
Returns the last N characters of the input string, up to at most the length of string.
Removes whitespace or specified characters from both ends of a string.
Examples
SELECT trim('  chalk  ');
| trim('  chalk  ') |
| ----------------- |
| chalk             |
SELECT trim('xychalkyx', 'xy');
| trim('xychalkyx', 'xy') |
| ----------------------- |
| chalk                   |
Normalizes Unicode characters to their closest ASCII equivalents with whitespace normalization.
Parameters
x:
large_string
The input value.
Converts Unicode characters to their closest ASCII equivalents.
Parameters
x:
large_string
The input value.
Converts a string to uppercase.
Parameters
string:
large_string
The input string.
Examples
SELECT upper('chalk');
| upper('chalk') |
| -------------- |
| CHALK          |
Returns the stem of a word using stemming algorithms.
Left-pads a string with zeros to the given width.
Overloads
Splits a string by delimiter and returns the part at the specified zero-based index.
Parameters
arg1:
large_string
The arg1 argument.
arg2:
large_string
The arg2 argument.
arg3:
int64
The arg3 argument.
operator alias for not like
Parameters
x:
large_string
The input value.
y:
large_string
The second input value.
operator alias for not ilike
Parameters
x:
large_string
The input value.
y:
large_string
The second input value.
Alias for starts_with.
Examples
SELECT starts_with('feature_store', 'feature');
| starts_with('feature_store', 'feature') |
| --------------------------------------- |
| true                                    |
operator alias for like
Parameters
x:
large_string
The input value.
y:
large_string
The second input value.
Case-insensitive like
Parameters
x:
large_string
The input value.
y:
large_string
The second input value.
Returns the current date.
Parameters
None
Converts a timestamp or string to a date.
Examples
SELECT date('2024-01-02');
| date('2024-01-02') |
| ------------------ |
| 2024-01-02         |
Overloads
Adds a duration or time-unit interval to a date or timestamp.
Examples
SELECT date_add('day', 7, TIMESTAMP '2024-01-02 00:00:00');
| date_add('day', 7, TIMESTAMP '2024-01-02 00:00:00') |
| --------------------------------------------------- |
| 2024-01-09 00:00:00                                 |
Returns the difference between two timestamps in the specified unit.
Parameters
unit:
large_string
The unit argument.
x1:
timestamp[us, tz=UTC]
The x1 argument.
x2:
timestamp[us, tz=UTC]
The x2 argument.
Formats a timestamp as a string using the specified format.
Parameters
x:
timestamp[us, tz=UTC]
The input value.
format:
large_string
The format string.
Truncates a timestamp to the specified time unit (e.g., day, month, year).
Parameters
unit:
large_string
The unit argument.
x:
timestamp[us, tz=UTC]
The input value.
Extracts the day of the month from a date or timestamp.
Overloads
Extracts the day of the month from a timestamp.
Extracts the day of the week from a timestamp.
Extracts the day of the month from a timestamp.
Returns the number of days in the month of the given date.
Extracts the day of the week from a date or timestamp.
Overloads
Extracts the day of the year from a date or timestamp.
Overloads
Formats a datetime using a specified format string.
Parameters
timestamp:
timestamp[us, tz=UTC]
The timestamp argument.
format:
large_string
The format string.
Formats a UTC timestamp as a string using a Joda format pattern in the given IANA timezone.
Parameters
arg1:
timestamp[us, tz=UTC]
The arg1 argument.
arg2:
large_string
The arg2 argument.
arg3:
large_string
The arg3 argument.
Parses an ISO 8601 date string into a date value.
Parameters
string:
large_string
The input string.
Parses an ISO 8601 timestamp string into a datetime object.
Parameters
string:
large_string
The input string.
Converts a UNIX timestamp to a timestamp, optionally with a time zone offset.
Examples
SELECT from_unixtime(1700000000);
| from_unixtime(1700000000) |
| ------------------------- |
| 2023-11-14 22:13:20 UTC   |
Extracts the hour from a timestamp.
Parameters
x:
timestamp[us, tz=UTC]
The input value.
Extracts the hour from a timestamp on a given timezone.
Parameters
x:
timestamp[us, tz=UTC]
The input value.
y:
large_string
The second input value.
Returns true if the date falls on a weekday (Monday-Friday).
Returns True if the given timestamp is a federal holiday.
Returns the last day of the month for a given date.
Parameters
x:
timestamp[us, tz=UTC]
The input value.
Constructs a date from year, month, and day fields.
Parameters
year:
int64
The year argument.
month:
int64
The month argument.
day:
int64
The day argument.
Extracts the millisecond from a timestamp.
Parameters
x:
timestamp[us, tz=UTC]
The input value.
Extracts the minute from a timestamp.
Parameters
x:
timestamp[us, tz=UTC]
The input value.
Extracts the month from a timestamp.
Overloads
Converts an ISO 8601 string into a datetime.
Parameters
string:
large_string
The input string.
format:
large_string
The format string.
Extracts the quarter of the year from a timestamp.
Parameters
x:
timestamp[us, tz=UTC]
The input value.
Extracts the second from a timestamp.
Parameters
x:
timestamp[us, tz=UTC]
The input value.
Constructs a duration with the given number of days.
Overloads
Constructs a duration with the given number of hours.
Overloads
Converts a datetime to an ISO 8601 string format.
Parameters
x:
timestamp[us, tz=UTC]
The input value.
Examples
SELECT to_iso8601(TIMESTAMP '2024-01-02 03:04:05');
| to_iso8601(TIMESTAMP '2024-01-02 03:04:05') |
| ------------------------------------------- |
| 2024-01-02T03:04:05.000000Z                 |
Converts a duration to microseconds or constructs a duration from microseconds.
Converts a duration to milliseconds or constructs a duration from milliseconds.
Constructs a duration with the given number of minutes.
Constructs a duration with the given number of seconds.
Converts a timestamp or date to nanoseconds since the Unix epoch (UTC). Throws if the value falls outside the int64 ns range (~1677 to ~2262).
Converts a timestamp to Unix timestamp (seconds since epoch).
Parameters
timestamp:
timestamp[us, tz=UTC]
The timestamp argument.
Returns the length of the input duration in seconds.
Parameters
x:
duration[us]
The input value.
Extracts the week of the year from a timestamp.
Overloads
Extracts the week of the year from a timestamp.
Extracts the year from a timestamp.
Overloads
Extracts the year of the ISO week from a date.
Extracts the year of the ISO week from a date.
Overloads
Returns true if all keys in the map match the given predicate.

Type parameters. K is the key type of the input map. V is the value type of the input map.

Parameters
map:
map<$K, $V>
The input map. K is the key type of the input map. V is the value type of the input map.
key:
($K) => bool
The map key to read or update. K is the key type of the input map.
Returns true if any key in the map matches the given predicate.

Type parameters. K is the key type of the input map. V is the value type of the input map.

Parameters
map:
map<$K, $V>
The input map. K is the key type of the input map. V is the value type of the input map.
key:
($K) => bool
The map key to read or update. K is the key type of the input map.
Returns true if any value in the map matches the given predicate.

Type parameters. K is the key type of the input map. V is the value type of the input map.

Parameters
map:
map<$K, $V>
The input map. K is the key type of the input map. V is the value type of the input map.
key:
($V) => bool
The map key to read or update. V is the value type of the input map.
Checks if a map contains any keys that match a given condition.

Type parameters. K is the key type of the input map. V is the value type of the input map.

Parameters
map:
map<$K, $V>
The input map. K is the key type of the input map. V is the value type of the input map.
key:
($k) => bool
The map key to read or update.
Filters the entries of a map using a callback predicate.

Type parameters. K is the key type of the input map. V is the value type of the input map.

Parameters
map:
map<$K, $V>
The input map. K is the key type of the input map. V is the value type of the input map.
key:
($K, $V) => bool
The map key to read or update. K is the key type of the input map. V is the value type of the input map.
Creates a map from separate arrays of keys and values.

Type parameters. K is the key type of the input map. V is the value type of the input map.

Retrieves a value from a map by key.

Type parameters. K is the key type of the input map. V is the value type of the input map.

Checks if a map contains any keys that match a given condition.

Type parameters. K is the key type of the input map. V is the value type of the input map.

Parameters
map:
map<$K, $V>
The input map. K is the key type of the input map. V is the value type of the input map.
key:
$K
The map key to read or update. K is the key type of the input map.
Returns all keys from a map as a list.

Type parameters. K is the key type of the input map. V is the value type of the input map.

Parameters
x:
map<$K, $V>
The input value. K is the key type of the input map. V is the value type of the input map.
Returns the keys of a map ordered by their top N highest values.

Type parameters. K is the key type of the input map. V is the value type of the input map.

Parameters
map:
map<$K, $V>
The input map. K is the key type of the input map. V is the value type of the input map.
key:
int64
The map key to read or update.
Returns a subset of a map containing only the specified keys.

Type parameters. K is the key type of the input map. V is the value type of the input map.

Returns the top N entries from a map ordered by value.

Type parameters. K is the key type of the input map. V is the value type of the input map.

Parameters
map:
map<$K, $V>
The input map. K is the key type of the input map. V is the value type of the input map.
key:
int64
The map key to read or update.
Returns the top N keys from a map ordered by their values.

Type parameters. K is the key type of the input map. V is the value type of the input map.

Parameters
map:
map<$K, $V>
The input map. K is the key type of the input map. V is the value type of the input map.
key:
int64
The map key to read or update.
Returns the top N values from a map ordered by value.

Type parameters. K is the key type of the input map. V is the value type of the input map.

Parameters
map:
map<$K, $V>
The input map. K is the key type of the input map. V is the value type of the input map.
key:
int64
The map key to read or update.
Returns all values from a map as a list.

Type parameters. K is the key type of the input map. V is the value type of the input map.

Parameters
x:
map<$K, $V>
The input value. K is the key type of the input map. V is the value type of the input map.
Merges two maps by applying a function to each matched key and pair of values.

Type parameters. K is the key type of the input map.

Parameters
map:
map<$K, $V1>
The input map. K is the key type of the input map.
key:
map<$K, $V2>
The map key to read or update. K is the key type of the input map.
function:
($K, $V1, $V2) => $V3
The function argument. K is the key type of the input map.
Returns true if no keys in the map match the given predicate.

Type parameters. K is the key type of the input map. V is the value type of the input map.

Parameters
map:
map<$K, $V>
The input map. K is the key type of the input map. V is the value type of the input map.
key:
($K) => bool
The map key to read or update. K is the key type of the input map.
Returns true if no values in the map match the given predicate.

Type parameters. K is the key type of the input map. V is the value type of the input map.

Parameters
map:
map<$K, $V>
The input map. K is the key type of the input map. V is the value type of the input map.
key:
($V) => bool
The map key to read or update. V is the value type of the input map.
Returns a map with keys transformed by the given function.

Type parameters. V is the value type of the input map.

Parameters
map:
map<$K1, $V>
The input map. V is the value type of the input map.
key:
($K1, $V) => $K2
The map key to read or update. V is the value type of the input map.
Returns a map with values transformed by the given function.

Type parameters. K is the key type of the input map.

Parameters
map:
map<$K, $V1>
The input map. K is the key type of the input map.
key:
($K, $V1) => $V2
The map key to read or update. K is the key type of the input map.
Compute the Beta cdf with given a, b parameters: P(N < value; a, b). The a, b parameters must be positive real numbers and value must be a real value (all of type DOUBLE). The value must lie on the interval [0, 1].
Parameters
a:
double
The a argument.
b:
double
The b argument.
value:
double
The input value.
Compute the Binomial cdf with given numberOfTrials and successProbability (for a single trial): P(N < value). The successProbability must be real value in [0, 1], numberOfTrials and value must be positive integers with numberOfTrials greater or equal to value.
Parameters
The numberOfTrials argument.
The successProbability argument.
value:
int64
The input value.
Compute the Cauchy cdf with given parameters median and scale (gamma): P(N; median, scale). The scale parameter must be a positive double. The value parameter must be a double on the interval [0, 1].
Parameters
median:
double
The median argument.
scale:
double
The scale argument.
value:
double
The input value.
Compute the Chi-square cdf with given df (degrees of freedom) parameter: P(N < value; df). The df parameter must be a positive real number, and value must be a non-negative real value (both of type DOUBLE).
Parameters
df:
double
The df argument.
value:
double
The input value.
Compute the F cdf with given df1 (numerator degrees of freedom) and df2 (denominator degrees of freedom) parameters: P(N < value; df1, df2). The numerator and denominator df parameters must be positive real numbers. The value must be a non-negative real number.
Parameters
df1:
double
The df1 argument.
df2:
double
The df2 argument.
value:
double
The input value.
Compute the Gamma cdf with given shape and scale parameters: P(N < value; shape, scale). The shape and scale parameters must be positive real numbers. The value must be a non-negative real number.
Parameters
shape:
double
The shape argument.
scale:
double
The scale argument.
value:
double
The input value.
Compute the inverse of the Beta cdf with given a, b parameters for the cumulative probability (p): P(N < n). The a, b parameters must be positive double values. The probability p must lie on the interval [0, 1].
Parameters
a:
double
The a argument.
b:
double
The b argument.
p:
double
The p argument.
Compute the inverse of the Binomial cdf with given numberOfTrials and successProbability (of a single trial) the cumulative probability (p): P(N <= n). The successProbability and p must be real values in [0, 1] and the numberOfTrials must be a positive integer.
Parameters
The numberOfTrials argument.
The successProbability argument.
p:
double
The p argument.
Compute the inverse of the Cauchy cdf with given parameters median and scale (gamma) for the probability p. The scale parameter must be a positive double. The probability p must be a double on the interval [0, 1].
Parameters
median:
double
The median argument.
scale:
double
The scale argument.
p:
double
The p argument.
Compute the inverse of the Chi-square cdf with given df (degrees of freedom) parameter for the cumulative probability (p): P(N < n). The df parameter must be positive real values. The probability p must lie on the interval [0, 1].
Parameters
df:
double
The df argument.
p:
double
The p argument.
Compute the inverse of the Fisher F cdf with a given df1 (numerator degrees of freedom) and df2 (denominator degrees of freedom) parameters for the cumulative probability (p): P(N < n). The numerator and denominator df parameters must be positive real numbers. The probability p must lie on the interval [0, 1].
Parameters
df1:
double
The df1 argument.
df2:
double
The df2 argument.
p:
double
The p argument.
Compute the inverse of the Laplace cdf with given mean and scale parameters for the cumulative probability (p): P(N < n). The mean must be a real value and the scale must be a positive real value (both of type DOUBLE). The probability p must lie on the interval [0, 1].
Parameters
mean:
double
The mean argument.
scale:
double
The scale argument.
p:
double
The p argument.
Compute the inverse of the Normal cdf with given mean and standard deviation (sd) for the cumulative probability (p): P(N < n). The mean must be a real value and the standard deviation must be a real and positive value (both of type DOUBLE). The probability p must lie on the interval (0, 1).
Parameters
mean:
double
The mean argument.
sd:
double
The sd argument.
p:
double
The p argument.
Compute the inverse of the Poisson cdf with given lambda (mean) parameter for the cumulative probability (p). It returns the value of n so that: P(N <= n; lambda) = p. The lambda parameter must be a positive real number (of type DOUBLE). The probability p must lie on the interval [0, 1).
Parameters
lambda:
double
The lambda argument.
p:
double
The p argument.
Compute the inverse of the Weibull cdf with given parameters a, b for the probability p. The a, b parameters must be positive double values. The probability p must be a double on the interval [0, 1].
Parameters
a:
double
The a argument.
b:
double
The b argument.
p:
double
The p argument.
Compute the Laplace cdf with given mean and scale parameters: P(N < value; mean, scale). The mean and value must be real values and the scale parameter must be a positive value (all of type DOUBLE).
Parameters
mean:
double
The mean argument.
scale:
double
The scale argument.
value:
double
The input value.
Compute the Normal cdf with given mean and standard deviation (sd): P(N < value; mean, sd). The mean and value must be real values and the standard deviation must be a real and positive value (all of type DOUBLE).
Parameters
mean:
double
The mean argument.
sd:
double
The sd argument.
value:
double
The input value.
Compute the Poisson cdf with given lambda (mean) parameter: P(N <= value; lambda). The lambda parameter must be a positive real number (of type DOUBLE) and value must be a non-negative integer.
Parameters
lambda:
double
The lambda argument.
value:
int32
The input value.
Compute the Weibull cdf with given parameters a, b: P(N <= value). The a and b parameters must be positive doubles and value must also be a double.
Parameters
a:
double
The a argument.
b:
double
The b argument.
value:
double
The input value.
Returns the bucket number for a value in a histogram with uniform bucket widths.
Parameters
x:
double
The input value.
bound1:
double
The bound1 argument.
bound2:
double
The bound2 argument.
n:
int64
The count or numeric argument.
Returns the lower bound of the Wilson score interval of a Bernoulli trial process at a confidence specified by the z-score z.
Parameters
The successes argument.
trials:
int64
The trials argument.
z:
double
The z argument.
Returns the upper bound of the Wilson score interval of a Bernoulli trial process at a confidence specified by the z-score z.
Parameters
The successes argument.
trials:
int64
The trials argument.
z:
double
The z argument.
Extracts a value from JSON or a JSON string using a path expression.
Extracts a value from JSON or a JSON string using a path expression and records invalid JSON errors.
Returns whether a JSON value or JSON string represents a scalar.
Returns the number of elements in a JSON array.
Parameters
json:
extension<arrow.json>
The json argument.
Extracts an array from JSON string using a path expression.
Extracts a scalar value from JSON or a JSON string using a JSONPath expression.
Returns the size of a JSON object or array at a path.
Converts an arbitrary value into a JSON string

Type parameters. T means matching inputs and outputs use the same type.

Parameters
x:
$T
The input value. T means matching inputs and outputs use the same type.
Evaluate a Rego query against a policy via the regorus interpreter. Arguments are (policy, query, input_json, data_json); the result is the regorus QueryResults serialized as a JSON string.
Decodes a Base64url-encoded string to binary data.
Parameters
string:
large_string
The input string.
Encodes binary data to a Base64url string.
Parameters
binary:
large_binary
The binary argument.
Decodes URL-encoded characters in a string.
Parameters
value:
large_string
The input value.
URL-encodes special characters in a string.
Parameters
value:
large_string
The input value.
Extracts the fragment portion (after #) from a URL.
Parameters
url:
large_string
The url argument.
Returns the host from a URL.
Parameters
url:
large_string
The url argument.
Extracts the value of a specific query parameter from a URL.
Parameters
url:
large_string
The url argument.
name:
large_string
The name argument.
Returns the path from a URL.
Parameters
url:
large_string
The url argument.
Extracts the port number from a URL.
Parameters
url:
large_string
The url argument.
Returns the protocol from a URL.
Parameters
url:
large_string
The url argument.
Extracts the query string portion (after ?) from a URL.
Parameters
url:
large_string
The url argument.
Downloads a file from object storage (gs://, s3://, abfs://) and returns the raw bytes. Returns null on error.
Parameters
uri:
large_string
The uri argument.
Downloads a file from object storage (gs://, s3://, abfs://) and returns a struct with data, success, error, and metadata.
Parameters
uri:
large_string
The uri argument.
Makes an HTTP request and returns the response.
Makes a completion request to OpenAI's chat API and returns the response.
Parameters
api_key:
large_string
The api_key argument.
prompt:
large_string
The prompt argument.
model:
large_string
The model argument.
The max_tokens argument.
The temperature argument.
Makes a completion request to OpenAI's chat API and returns the raw JSON response string.
Parameters
api_key:
large_string
The api_key argument.
prompt:
large_string
The prompt argument.
model:
large_string
The model argument.
The max_tokens argument.
The temperature argument.
Invokes an AWS SageMaker endpoint for inference with the provided binary input and returns the binary output.
Parameters
x:
large_binary
The input value.
endpoint:
large_string
The endpoint argument.
content_type:
large_string
The content_type argument.
target_model:
large_string
The target_model argument.
target_variant:
large_string
The target_variant argument.
The aws_access_key_id_override argument.
The aws_secret_access_key_override argument.
The aws_session_token_override argument.
The aws_role_arn_override argument.
The aws_region_override argument.
The aws_profile_name_override argument.
The inference_component argument.
Invokes a Vertex AI endpoint for inference with binary input, returns binary output.
Parameters
x:
large_binary
The input value.
endpoint:
large_string
The endpoint argument.
content_type:
large_string
= NULL
The content_type argument.
gcp_credentials_override:
large_string
= NULL
The gcp_credentials_override argument.
dedicated_endpoint_dns:
large_string
= NULL
The dedicated_endpoint_dns argument.
method:
large_string
= NULL
The method argument.
api_host:
large_string
= NULL
The api_host argument.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_string
The input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
y:
large_binary
The second input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
y:
double
The second input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
y:
large_binary
The second input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
y:
large_binary
The second input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
y:
large_binary
The second input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
y:
large_binary
The second input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
y:
large_binary
The second input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
y:
large_binary
The second input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_string
The input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
y:
int32
The second input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
y:
int32
The second input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
y:
large_binary
The second input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
y:
large_binary
The second input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_string
The input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_list<item: large_binary>
The input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_list<item: large_binary>
The input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
y:
large_binary
The second input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
double
The input value.
y:
double
The second input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
y:
int32
The second input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_string
The input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
arg1:
large_binary
The arg1 argument.
arg2:
large_binary
The arg2 argument.
arg3:
large_string
The arg3 argument.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
y:
large_binary
The second input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
y:
large_binary
The second input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
y:
large_binary
The second input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
y:
large_binary
The second input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
Geospatial (Presto-flavored Velox geometry function).
Parameters
x:
large_binary
The input value.
Calculates the lat-lon in degrees for a given h3 cell.
Parameters
x:
large_string
The input value.
Calculates the lat-lon for a given h3 cell.
Parameters
x:
large_string
The input value.
Converts Avro binary data to a structured format using an Avro schema.

Type parameters. T means matching inputs and outputs use the same type.

Parameters
arg1:
large_string
The arg1 argument.
The arg2 argument. T means matching inputs and outputs use the same type.
arg3:
large_binary
The arg3 argument.
Decodes a Base64-encoded string to binary data.
Parameters
string:
large_string
The input string.
Convert a 32-bit big-endian bytes value to an integer.
Convert a 64-bit big-endian bytes value to an integer.
Converts a hexadecimal string to binary data.
Parameters
string:
large_string
The input string.
Decodes the 32-bit big-endian binary representation of an IEEE 754 floating-point value.
Parameters
binary:
large_binary
The binary argument.
Decodes the 64-bit big-endian binary representation of an IEEE 754 floating-point value.
Parameters
binary:
large_binary
The binary argument.
Decompress snappy-compressed binary data.
gunzip the input binary data.
Overloads
Converts protobuf binary data to a structured format.

Type parameters. T means matching inputs and outputs use the same type.

Parameters
arg1:
large_binary
The arg1 argument.
arg2:
large_string
The arg2 argument.
The arg3 argument. T means matching inputs and outputs use the same type.
arg4:
large_binary
The arg4 argument.
Converts protobuf binary data to a structured format, recording parse errors with row attribution.

Type parameters. T means matching inputs and outputs use the same type.

Parameters
arg1:
large_binary
The arg1 argument.
arg2:
large_string
The arg2 argument.
The arg3 argument. T means matching inputs and outputs use the same type.
arg4:
large_binary
The arg4 argument.
Converts structured data to protobuf binary format.

Type parameters. T means matching inputs and outputs use the same type.

Parameters
arg1:
large_binary
The arg1 argument.
arg2:
large_string
The arg2 argument.
The arg3 argument. T means matching inputs and outputs use the same type.
Encodes binary data to a Base64 string.
Parameters
binary:
large_binary
The binary argument.
Encodes an integer into a 32-bit big-endian binary representation.
Parameters
integer:
int32
The integer argument.
Encodes a bigint into a 64-bit big-endian binary representation.
Parameters
bigint:
int64
The bigint argument.
Converts binary data to its hexadecimal string representation.
Parameters
binary:
large_binary
The binary argument.
Encodes a float as a 32-bit big-endian binary in IEEE 754 format.
Parameters
real:
float
The real argument.
Encodes a double as a 64-bit big-endian binary in IEEE 754 format.
Parameters
double:
double
The double argument.
Calculates the CRC32 checksum of binary data.
Parameters
binary:
large_binary
The binary argument.
Computes HMAC-MD5 authentication code for data using a secret key.
Parameters
binary:
large_binary
The binary argument.
key:
large_binary
The map key to read or update.
Computes HMAC-SHA1 authentication code for data using a secret key.
Parameters
binary:
large_binary
The binary argument.
key:
large_binary
The map key to read or update.
Computes HMAC-SHA256 authentication code for data using a secret key.
Parameters
binary:
large_binary
The binary argument.
key:
large_binary
The map key to read or update.
Computes HMAC-SHA512 authentication code for data using a secret key.
Parameters
binary:
large_binary
The binary argument.
key:
large_binary
The map key to read or update.
Computes the MD5 hash of binary data.
Parameters
binary:
large_binary
The binary argument.
Computes the SHA-1 hash of binary data.
Parameters
binary:
large_binary
The binary argument.
Computes the SHA-256 hash of binary data.
Parameters
binary:
large_binary
The binary argument.
Computes the SHA-512 hash of binary data.
Parameters
binary:
large_binary
The binary argument.
Computes a 32-bit SpookyHash V2 hash of binary data.
Parameters
binary:
large_binary
The binary argument.
Computes a 64-bit SpookyHash V2 hash of binary data.
Parameters
binary:
large_binary
The binary argument.
Computes a 64-bit XXHash of binary data, optionally with a seed.
Converts a string representation of a number in a given base to an integer.
Parameters
string:
large_string
The input string.
radix:
int64
The radix argument.
Decodes UTF-8 encoded binary data, optionally replacing invalid sequences.
Converts an integer to its string representation in the specified base.
Parameters
x:
int64
The input value.
radix:
int64
The radix argument.
Encodes a string to UTF-8 binary data.
Parameters
string:
large_string
The input string.
Raises an error with the specified error message.
Attempts to execute an expression and handles any errors gracefully.

Type parameters. T means matching inputs and outputs use the same type.

Parameters
x:
$T
The input value. T means matching inputs and outputs use the same type.