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.
Overloads
Calculates the inverse cosine in radians.
Parameters
x:
double
Calculates the inverse sine in radians.
Parameters
x:
double
Calculates the arctangent of a number in radians.
Parameters
x:
double
Calculates the arctangent of y/x in radians, handling quadrant correctly.
Parameters
y:
double
x:
double
Either:
  • Rounds a number using banker's rounding (round half to even).
  • Rounds a number to specified decimal places using banker's rounding (round half to even).
Either:
  • Calculates the cube root of a number.
  • Calculates the cube root of an integer.
Overloads
Alias for ceiling.
Returns the smallest integer greater than or equal to the given number.
Either:
  • Constrains a value between a minimum and maximum range.
  • Constrains an integer value between a minimum and maximum range.
Calculates the cosine of an angle in radians.
Parameters
x:
double
Calculates the hyperbolic cosine of a number.
Parameters
x:
double
Converts radians to degrees.
Parameters
x:
double
Returns the mathematical constant e (Euler's number).
Parameters
None
Calculates e raised to the power of a number.
Parameters
x:
double
Returns the largest integer less than or equal to the given number.
Overloads
Checks if a floating-point number is finite (not NaN or infinite).
Parameters
x:
double
Checks if a floating-point number is infinite.
Parameters
x:
double
Checks if a floating-point number is NaN (Not a Number).
Parameters
x:
double
Calculates the natural logarithm of a number.
Parameters
x:
double
Either:
  • Calculates the logarithm of x with the given base.
  • Calculates the base-10 logarithm of a number.
Overloads
Calculates the base-10 logarithm of a number.
Parameters
x:
double
Calculates the base-2 logarithm of a number.
Parameters
x:
double
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
p:
double
Raises the first number to the power of the second number.
Parameters
x:
double
p:
double
Converts degrees to radians.
Parameters
x:
double
Either:
  • Rounds a floating point number to the nearest integer.
  • Rounds a floating point number to the specified number of decimal places.
Either:
  • Returns the sign of a number (-1, 0, or 1).
  • Returns the sign of an integer (-1, 0, or 1).
Overloads
Calculates the sine of an angle in radians.
Parameters
x:
double
Calculates the square root of a number.
Parameters
x:
double
Calculates the tangent of an angle in radians.
Parameters
x:
double
Calculates the hyperbolic tangent of a number.
Parameters
x:
double
Either:
  • Truncates a floating-point number to remove the decimal part.
  • Truncates a floating-point number to have `n` digits after the decimal.
Either:
  • Calculates the modulo (remainder) of two integers.
  • Calculates the modulo (remainder) of two floating-point numbers.
Overloads
Either:
  • basic binary * operation
  • num * duration multiplication
basic binary ** operation
Parameters
x:
double
y:
double
Either:
  • number + number addition
  • time + duration addition
  • string or binary concatenation
  • interval + interval addition
  • timestamp + interval addition
  • interval + timestamp addition
Either:
  • time - duration subtraction
  • basic binary - operation
  • date(time) subtraction
  • Returns the negative value of a number.
  • interval - interval subtraction
  • timestamp - interval subtraction
Either:
  • basic binary float / operation
  • duration / num division
Overloads
floor division
Checks if a value is between two bounds (inclusive).
Parameters
x:
$T_ord
min:
$T_ord
max:
$T_ord
Checks if two values are distinct, treating NULL values as different from non-NULL values.
Parameters
x:
$T
y:
$T
Either:
  • eq
  • Compares if two values are equal.
Either:
  • gt
  • Compares if the first value is greater than the second.
Either:
  • gte
  • Compares if the first value is greater than or equal to the second.
Either:
  • lt
  • Compares if the first value is less than the second.
Either:
  • lte
  • Compares if the first value is less than or equal to the second.
Either:
  • neq
  • Compares if two values are not equal.
basic binary != operation
Parameters
x:
$T
y:
$T
basic binary < operation
Parameters
x:
$T_ord
y:
$T_ord
basic binary <= operation
Parameters
x:
$T_ord
y:
$T_ord
basic binary == operation
Parameters
x:
$T
y:
$T
basic binary > operation
Parameters
x:
$T_ord
y:
$T_ord
basic binary >= operation
Parameters
x:
$T_ord
y:
$T_ord
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
shift:
int64
Returns the logical right shift operation on x (treated as bits-bit integer) shifted by shift. shift must not be negative.
Parameters
x:
int64
shift:
int64
bits:
int64
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
shift:
int64
bits:
int64
Performs bitwise XOR operation on two integer values.
Either:
  • boolean & operation
  • Performs bitwise AND operation on two integer values.
Either:
  • boolean | operation
  • Performs bitwise OR operation on two integer values.
Either:
  • boolean ~ operation
  • Performs bitwise NOT operation (complement) on an integer value.
Overloads
~(x)
~(x)
~(x)
~(x)
~(x)
~(x)
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.
Either:
  • Creates an empty array.
  • Creates an array from a variable number of arguments.
Calculates the cumulative sum of numeric values in an array.
Returns an array with duplicate elements removed, preserving order.
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.
Filters an array using a callback function predicate.
Parameters
array:
large_list<item: $T>
predicate:
($T) => bool
Returns a map of elements to their frequency counts in an array.
Parameters
x:
large_list<item: $T>
Checks if an array contains duplicate elements.
Returns the intersection of two arrays (elements present in both arrays).
Either:
  • Joins elements of an array into a string using a separator, replacing nulls with null_replacement.
  • Joins elements of a large array into a string using a separator, replacing nulls.
  • Joins elements of an array into a string using a separator.
  • Joins elements of a large array into a string using a separator.
Returns the maximum element in an array.
Calculates the median value of numeric elements in an array.
Returns the minimum element in an array.
Either:
  • Returns the most frequently occurring element in an array.
  • Returns the most frequently occurring element in an array with mode selection option.
Either:
  • Returns the 1-based position of the first occurrence of an element in an array.
  • Returns the 1-based position of the ``instance``th value in an array.
Applies a reduce function to each element in an array and returns the accumulated value.
Parameters
array:
large_list<item: $T>
inputFunction:
($U, $T) => $U
outputFunction:
($U) => $V
Removes all occurrences of a specified element from an array.
Either:
  • Sorts an array in ascending order.
  • Sorts an array using a key extraction function.
Either:
  • Sorts an array in descending order using a key extraction function.
  • Sorts an array in descending order.
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.
Parameters
array:
large_list<item: $T>
function:
($T) => $U
Checks if two arrays have any elements in common.
Returns a list of the distinct elements of the common elements
Either:
  • Returns the number of elements in a list.
  • Returns the number of entries in a map.
Checks if a list contains a specific element.
Parameters
x:
large_list<item: $V>
Either:
  • Returns the element at the specified index in a list.
  • Retrieves the value associated with a key from a map.
Returns the first element in an array that matches the given predicate function.
Returns the 1-based index of the first element in an array that matches the given predicate function.
Flattens a nested array by one level, combining all sub-arrays into a single array.
Either:
  • Returns the maximum value from a list of float values.
  • Returns the maximum value from a list of integer values.
Either:
  • Returns the minimum value from a list of float values.
  • Returns the minimum value from a list of integer values.
Returns the element at the specified Python-style index in a list.
Combines multiple lists element-wise into a list of paired structures with Python semantics.
Removes all null values from an array.
Randomly shuffles the elements of an array.
Returns a slice of a list starting at the given position for the specified length.
Applies a transformation function to each element in an array and returns a new array.
Combines two lists element-wise into a list of paired structures.
Parameters
array1:
large_list<item: $T>
array2:
large_list<item: $U>
Combines two lists element-wise using a callback function to transform paired elements.
Parameters
array1:
large_list<item: $T>
array2:
large_list<item: $U>
function:
($T, $U) => $R
Finds all matches of a regular expression pattern in a string and returns them as a list.
Parameters
x:
large_string
y:
large_string
Converts an integer to its corresponding ASCII character.
Parameters
n:
int64
Returns the Unicode code point of the only character of the string.
Either:
  • Concatenates two or more strings together.
  • Concatenates two or more blobs together.
  • Concatenates two or more lists together.
Checks if a string ends with a specified suffix.
Parameters
string:
large_string
substring:
large_string
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.
Calculates the Jaccard similarity coefficient between two strings based on character sets.
Parameters
x:
large_string
y:
large_string
Calculates the Jaro-Winkler distance between two strings.
Parameters
arg1:
large_string
arg2:
large_string
arg3:
double
Either:
  • Returns the length of the binary in bytes.
  • Returns the length of a string in characters.
  • Returns the number of elements in a list.
Calculates the Levenshtein distance between two strings.
Parameters
x:
large_string
y:
large_string
Checks if a string matches a pattern using SQL LIKE syntax with wildcards.
Parameters
string:
large_string
pattern:
large_string
Calculates the longest common subsequence between two strings.
Parameters
x:
large_string
y:
large_string
Converts a string to lowercase.
Parameters
string:
large_string
Either:
  • Left pads binary to size bytes with padbinary.
  • Pads a string with a specified padding string on the left to reach a target length.
Either:
  • Removes whitespace from the left end of a string.
  • Removes specified characters from the left end of a string.
Calculates the partial ratio similarity between two strings using fuzzy matching.
Parameters
x:
large_string
y:
large_string
Either:
  • Returns the first substring matched by the regular expression pattern in string.
  • Returns the first substring matched by the regular expression pattern in string and returns the capturing group number group.
Either:
  • Returns the substring(s) matched by the regular expression pattern in string.
  • Returns the substring(s) matched by the regular expression pattern in string and returns the capturing group number group.
Checks if a string matches a regular expression pattern.
Parameters
x:
large_string
y:
large_string
Checks if a string matches a regular expression pattern.
Parameters
string:
large_string
pattern:
large_string
Either:
  • Replaces all matches of a regular expression pattern with a replacement string.
  • Removes all matches of a regular expression pattern from a string.
  • Replaces every instance of the substring matched by the regular expression ``pattern`` in ``string`` using ``function``. The lambda expression ``function`` is invoked for each match with the capturing groups passed as an array. Capturing group numbers start at 1; there is no group for the entire match (if you need this, surround the entire expression with parenthesis).
Splits ``string`` using the regular expression ``pattern`` into a list of strings.
Parameters
string:
large_string
pattern:
large_string
Either:
  • Removes all occurrences of search from string.
  • Replaces all occurrences of a substring with another string.
Either:
  • Returns input binary with bytes in reversed order.
  • Reverses the characters in a string.
  • Returns the array in reversed order.
Either:
  • Right pads binary to size bytes with padbinary.
  • Pads a string with a specified padding string on the right to reach a target length.
Either:
  • Removes whitespace from the right end of a string.
  • Removes specified characters from the right end of a string.
Computes the similarity ratio between two strings using sequence matching.
Parameters
x:
large_string
y:
large_string
Either:
  • Splits a string by a delimiter into a list of strings.
  • Splits a string by a delimiter with a maximum number of splits.
Splits a string by delimiter and returns the part at the specified index (1-based).
Parameters
string:
large_string
delimiter:
large_string
index:
int64
Checks if a string starts with a specified prefix.
Parameters
string:
large_string
substring:
large_string
Either:
  • Returns the position of the N-th occurrence of a substring within a string.
  • Returns the position of the first occurrence of a substring within a string.
Either:
  • Returns the position of the N-th occurrence of a substring from the end of a string.
  • Returns the position of the last occurrence of a substring within a string.
Either:
  • Returns a substring starting at the specified position.
  • Returns a substring starting at the specified position with the given length.
Calculates the token set ratio similarity between two strings using fuzzy matching.
Parameters
x:
large_string
y:
large_string
Calculates the token sort ratio similarity between two strings using fuzzy matching.
Parameters
x:
large_string
y:
large_string
Returns the last N characters of the input string, up to at most the length of string.
Either:
  • Removes whitespace from both ends of a string.
  • Removes specified characters from both ends of a string.
Normalizes Unicode characters to their closest ASCII equivalents with whitespace normalization.
Parameters
x:
large_string
Converts Unicode characters to their closest ASCII equivalents.
Parameters
x:
large_string
Converts a string to uppercase.
Parameters
string:
large_string
Returns the stem of a word using stemming algorithms.
Splits a string by delimiter and returns the part at the specified zero-based index.
Parameters
arg1:
large_string
arg2:
large_string
arg3:
int64
Returns the current date.
Parameters
None
Either:
  • Adds the specified value of unit to a timestamp.
  • date + duration addition
Truncates a timestamp to the specified time unit (e.g., day, month, year).
Parameters
unit:
large_string
x:
timestamp[us, tz=UTC]
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.
Formats a datetime using a specified format string.
Parameters
timestamp:
timestamp[us, tz=UTC]
format:
large_string
Parses an ISO 8601 timestamp string into a datetime object.
Parameters
string:
large_string
Either:
  • Returns the UNIX timestamp unixtime as a timestamp with time zone using hours and minutes for the time zone offset.
  • Returns the UNIX timestamp unixtime as a timestamp with time zone.
Extracts the hour from a timestamp.
Parameters
x:
timestamp[us, tz=UTC]
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]
Extracts the millisecond from a timestamp.
Parameters
x:
timestamp[us, tz=UTC]
Extracts the minute from a timestamp.
Parameters
x:
timestamp[us, tz=UTC]
Extracts the month from a timestamp.
Overloads
Converts an ISO 8601 string into a datetime.
Parameters
string:
large_string
format:
large_string
Extracts the quarter of the year from a timestamp.
Parameters
x:
timestamp[us, tz=UTC]
Extracts the second from a timestamp.
Parameters
x:
timestamp[us, tz=UTC]
Converts a datetime to an ISO 8601 string format.
Parameters
x:
timestamp[us, tz=UTC]
Either:
  • Converts a duration to microseconds.
  • Constructs a duration with the given number of milliseconds.
Either:
  • Converts a duration to milliseconds.
  • Constructs a duration with the given number of milliseconds.
Converts a timestamp to Unix timestamp (seconds since epoch).
Parameters
timestamp:
timestamp[us, tz=UTC]
Returns the length of the input duration in seconds.
Parameters
x:
duration[us]
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
Checks if a map contains any keys that match a given condition.
Parameters
x:
map<$K, $V>
y:
($k) => bool
Filters the entries of a map using a callback predicate.
Parameters
map:
map<$K, $V>
predicate:
($K, $V) => bool
Either:
  • Retrieves the value associated with a key from a map.
  • Retrieves the value associated with a string key from a map with automatic key type casting.
Checks if a map contains any keys that match a given condition.
Parameters
x:
map<$K, $V>
y:
$K
Returns all keys from a map as a list.
Parameters
x:
map<$K, $V>
Returns the keys of a map ordered by their top N highest values.
Parameters
map:
map<$K, $V>
n:
int64
Returns a subset of a map containing only the specified keys.
Returns the top N entries from a map ordered by value.
Parameters
map:
map<$K, $V>
n:
int64
Returns the top N keys from a map ordered by their values.
Parameters
map:
map<$K, $V>
n:
int64
Returns the top N values from a map ordered by value.
Parameters
map:
map<$K, $V>
n:
int64
Returns all values from a map as a list.
Parameters
x:
map<$K, $V>
Merges two maps by applying a function to each matched key and pair of values.
Parameters
map1:
map<$K, $V1>
map2:
map<$K, $V2>
function:
($K, $V1, $V2) => $V3
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
b:
double
value:
double
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
value:
int64
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
scale:
double
value:
double
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
value:
double
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
df2:
double
value:
double
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
scale:
double
value:
double
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
b:
double
p:
double
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
p:
double
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
scale:
double
p:
double
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
p:
double
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
df2:
double
p:
double
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
scale:
double
p:
double
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
sd:
double
p:
double
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
p:
double
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
b:
double
p:
double
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
scale:
double
value:
double
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
sd:
double
value:
double
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
value:
int32
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
b:
double
value:
double
Returns the bucket number for a value in a histogram with uniform bucket widths.
Parameters
x:
double
bound1:
double
bound2:
double
n:
int64
Returns the lower bound of the Wilson score interval of a Bernoulli trial process at a confidence specified by the z-score z.
Parameters
trials:
int64
z:
double
Returns the upper bound of the Wilson score interval of a Bernoulli trial process at a confidence specified by the z-score z.
Parameters
trials:
int64
z:
double
Either:
  • Extracts a value from JSON using a path expression.
  • Extracts a value from JSON string using a path expression.
Either:
  • Extracts a value from JSON using a path expression. Records errors for invalid JSON.
  • Extracts a value from JSON string using a path expression. Records errors for invalid JSON.
  • Extracts a value from JSON using a path expression. Records errors for invalid JSON.
Either:
  • Returns true if the JSON value is a scalar (number, string, true, false, or null).
  • Returns true if the JSON string represents a scalar value.
Returns the number of elements in a JSON array.
Parameters
json:
extension<arrow.json>
Extracts an array from JSON string using a path expression.
Either:
  • Extracts a scalar value from JSON using a JSONPath expression.
  • Extracts a scalar value from a JSON string using a JSONPath expression.
Either:
  • Returns the size of a JSON object or array at the given path, or 0 for scalar values.
  • Returns the size of a JSON value at the given path.
Converts an arbitrary value into a JSON string
Parameters
x:
$T
Decodes a Base64url-encoded string to binary data.
Parameters
string:
large_string
Either:
  • Makes an HTTP request with string body and returns the response as bytes.
  • Makes an HTTP request with binary body and returns the response as bytes.
Encodes binary data to a Base64url string.
Parameters
binary:
large_binary
Decodes URL-encoded characters in a string.
Parameters
value:
large_string
URL-encodes special characters in a string.
Parameters
value:
large_string
Extracts the fragment portion (after #) from a URL.
Parameters
url:
large_string
Returns the host from a URL.
Parameters
url:
large_string
Extracts the value of a specific query parameter from a URL.
Parameters
url:
large_string
name:
large_string
Returns the path from a URL.
Parameters
url:
large_string
Extracts the port number from a URL.
Parameters
url:
large_string
Returns the protocol from a URL.
Parameters
url:
large_string
Extracts the query string portion (after ?) from a URL.
Parameters
url:
large_string
Makes a completion request to OpenAI's chat API and returns the response.
Parameters
arg1:
large_string
arg2:
large_string
arg3:
large_string
arg4:
int64
arg5:
double
Invokes an AWS SageMaker endpoint for inference with the provided binary input and returns the binary output.
Parameters
x:
large_binary
endpoint:
large_string
content_type:
large_string
target_model:
large_string
target_variant:
large_string
Calculates the lat-lon in degrees for a given h3 cell.
Parameters
x:
large_string
Calculates the lat-lon for a given h3 cell.
Parameters
x:
large_string
Calculates the CRC32 checksum of binary data.
Parameters
binary:
large_binary
Decodes a Base64-encoded string to binary data.
Parameters
string:
large_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
Decompress snappy-compressed binary data.
gunzip the input binary data.
Overloads
Computes HMAC-MD5 authentication code for data using a secret key.
Parameters
binary:
large_binary
key:
large_binary
Computes HMAC-SHA1 authentication code for data using a secret key.
Parameters
binary:
large_binary
key:
large_binary
Computes HMAC-SHA256 authentication code for data using a secret key.
Parameters
binary:
large_binary
key:
large_binary
Computes HMAC-SHA512 authentication code for data using a secret key.
Parameters
binary:
large_binary
key:
large_binary
Computes the MD5 hash of binary data.
Parameters
binary:
large_binary
Converts protobuf binary data to a structured format.
Parameters
arg1:
large_binary
arg2:
large_string
arg4:
large_binary
Converts protobuf binary data to a structured format, recording parse errors with row attribution.
Parameters
arg1:
large_binary
arg2:
large_string
arg4:
large_binary
Computes the SHA-1 hash of binary data.
Parameters
binary:
large_binary
Computes the SHA-256 hash of binary data.
Parameters
binary:
large_binary
Computes the SHA-512 hash of binary data.
Parameters
binary:
large_binary
Computes a 32-bit SpookyHash V2 hash of binary data.
Parameters
binary:
large_binary
Computes a 64-bit SpookyHash V2 hash of binary data.
Parameters
binary:
large_binary
Converts structured data to protobuf binary format.
Parameters
arg1:
large_binary
arg2:
large_string
Encodes binary data to a Base64 string.
Parameters
binary:
large_binary
Encodes an integer into a 32-bit big-endian binary representation.
Parameters
integer:
int32
Encodes a bigint into a 64-bit big-endian binary representation.
Parameters
bigint:
int64
Converts binary data to its hexadecimal string representation.
Parameters
binary:
large_binary
Either:
  • Computes a 64-bit XXHash of binary data with a seed.
  • Computes a 64-bit XXHash of binary data.
Converts a string representation of a number in a given base to an integer.
Parameters
string:
large_string
radix:
int64
Either:
  • Decodes UTF-8 encoded binary, replacing invalid sequences with the given code point.
  • Decodes UTF-8 encoded binary, replacing invalid sequences with the given string.
  • Decodes UTF-8 encoded binary data into a string.
Converts an integer to its string representation in the specified base.
Parameters
x:
int64
radix:
int64
Encodes a string to UTF-8 binary data.
Parameters
string:
large_string
Returns true if all keys in the map match the given predicate.
Parameters
x:
map<$K, $V>
predicate:
($K) => bool
Returns true if every element of the array satisfies the predicate.
Performs logical AND operation on two boolean values.
Parameters
x:
bool
y:
bool
Returns true if any key in the map matches the given predicate.
Parameters
x:
map<$K, $V>
predicate:
($K) => bool
Returns true if any element of the array satisfies the predicate.
Returns true if any value in the map matches the given predicate.
Parameters
x:
map<$K, $V>
predicate:
($V) => bool
Calculates the inverse hyperbolic cosine.
Parameters
x:
double
Calculates the inverse hyperbolic sine.
Parameters
x:
double
Calculates the inverse hyperbolic tangent.
Parameters
x:
double
Converts Avro binary data to a structured format using an Avro schema.
Parameters
arg1:
large_string
arg3:
large_binary
Counts the number of bits in `x`.
Parameters
x:
int64
bits:
int64
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
y:
large_string
Returns the first non-null value from a list of arguments.
Parameters
x:
$T
y:
$T...
Returns all possible combinations of the given size from an array.
Calculates the cotangent of an angle in radians.
Parameters
x:
double
Counts the number of non-overlapping regex matches in a string.
Either:
  • Converts a timestamp to a date.
  • Converts a string to a date.
Overloads
Returns the difference between two timestamps in the specified unit.
Parameters
unit:
large_string
x1:
timestamp[us, tz=UTC]
x2:
timestamp[us, tz=UTC]
Formats a timestamp as a string using the specified format.
Parameters
x:
timestamp[us, tz=UTC]
format:
large_string
Extracts the day of the month from a date or timestamp.
Overloads
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
Raises an error with the specified error message.
Decodes the 32-bit big-endian binary representation of an IEEE 754 floating-point value.
Parameters
binary:
large_binary
Decodes the 64-bit big-endian binary representation of an IEEE 754 floating-point value.
Parameters
binary:
large_binary
Parses an ISO 8601 date string into a date value.
Parameters
string:
large_string
Returns the second argument if the condition is true, otherwise returns the third argument.
Parameters
arg1:
bool
Case-insensitive like
Parameters
x:
large_string
y:
large_string
Returns true if the date falls on a weekday (Monday-Friday).
Checks if the input is null.
Parameters
x:
$T
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
y:
large_string
Returns the byte length of a string.
Calculates the natural logarithm of (1 + x), accurate for small x.
Parameters
x:
double
Returns all N-grams (contiguous subsequences of length n) from an array.
Returns true if no keys in the map match the given predicate.
Parameters
x:
map<$K, $V>
predicate:
($K) => bool
Returns true if no values in the map match the given predicate.
Parameters
x:
map<$K, $V>
predicate:
($V) => bool
Returns true if no element of the array satisfies the predicate.
Either:
  • Transforms string with NFC normalization form.
  • Transforms string with the specified Unicode normalization form.
Either:
  • Returns the byte length of a string.
  • Returns the length of the binary in bytes.
Checks if two values are equal, treating NULL values as equal to other NULL values.
Parameters
x:
$T
y:
$T
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.
Checks if two values are not equal, treating NULL values as different from non-NULL values.
Parameters
x:
$T
y:
$T
Creates a range of integers with Python-like semantics.
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.
Generates a random float between 0 and 1.
Parameters
None
Either:
  • Generates a pseudo-random float between 0 and 1.
  • Generates a pseudo-random integer within the bounds of the specified type.
Returns an array containing the element repeated count times.
Parameters
count:
int32
Rounds a number to n significant figures.
Parameters
x:
double
y:
int64
Either:
  • Generates a cryptographically secure random float between 0 and 1.
  • Generates a cryptographically secure random number between the specified bounds.
Either:
  • Generates a sequence of integers from start to stop (inclusive).
  • Generates a sequence of integers from start to stop (inclusive) with a specified step.
Returns the element at the specified 1-based index in the array.
Converts a string to title case.
Constructs a duration with the given number of milliseconds.
Parameters
x:
int64
Constructs a duration with the given number of milliseconds.
Parameters
x:
int64
Encodes a float as a 32-bit big-endian binary in IEEE 754 format.
Parameters
real:
float
Encodes a double as a 64-bit big-endian binary in IEEE 754 format.
Parameters
double:
double
Constructs a duration with the given number of milliseconds.
Parameters
x:
int64
Constructs a duration with the given number of milliseconds.
Parameters
x:
int64
Returns a map with keys transformed by the given function.
Parameters
map:
map<$K1, $V>
function:
($K1, $V) => $K2
Returns a map with values transformed by the given function.
Parameters
map:
map<$K, $V1>
function:
($K, $V1) => $V2
Removes the last n elements from the array.
Attempts to execute an expression and handles any errors gracefully.
Parameters
x:
$T
Left-pads a string with zeros to the given width.
Overloads
operator alias for not like
Parameters
x:
large_string
y:
large_string
operator alias for not ilike
Parameters
x:
large_string
y:
large_string
operator alias for list_has_any
Overloads
Alias for pow.
Alias for starts_with.
Alias for concat.
operator alias for like
Parameters
x:
large_string
y:
large_string
Case-insensitive like
Parameters
x:
large_string
y:
large_string