Compute Functions¶
Aggregations¶
|
Test whether all elements in a boolean array evaluate to true. |
|
Test whether any element in a boolean array evaluates to true. |
|
Approximate median of a numeric array with T-Digest algorithm. |
|
Count the number of null / non-null values. |
|
Count the number of unique values. |
|
Find the index of the first occurrence of a given value. |
|
Compute the minimum or maximum values of a numeric array. |
|
Compute the mean of a numeric array. |
|
Compute the minimum or maximum values of a numeric array. |
|
Compute the minimum and maximum values of a numeric array. |
|
Return top-n most common values and number of times they occur in a passed numerical (chunked) array, in descending order of occurrence. |
|
Compute the product of values in a numeric array. |
|
Compute an array of quantiles of a numeric array or chunked array. |
|
Calculate the standard deviation of a numeric array. |
|
Compute the sum of a numeric array. |
|
Approximate quantiles of a numeric array with T-Digest algorithm. |
|
Calculate the variance of a numeric array. |
Grouped Aggregations¶
|
Test whether all elements evaluate to true. |
|
Test whether any element evaluates to true. |
|
Calculate approximate medians of a numeric array with the T-Digest algorithm. |
|
Count the number of null / non-null values. |
|
Count the distinct values in each group. |
|
Keep the distinct values in each group. |
|
Compute the minimum or maximum values of a numeric array. |
|
Average values of a numeric array. |
|
Compute the minimum or maximum values of a numeric array. |
|
Compute the minimum and maximum values of a numeric array. |
|
Compute product of values of a numeric array. |
|
Calculate the standard deviation of a numeric array. |
|
Sum values of a numeric array. |
|
Calculate approximate quantiles of a numeric array with the T-Digest algorithm. |
|
Calculate the variance of a numeric array. |
Arithmetic Functions¶
By default these functions do not detect overflow. Most functions are also
available in an overflow-checking variant, suffixed _checked
, which
throws an ArrowInvalid
exception when overflow is detected.
|
Calculate the absolute value of the argument element-wise. |
|
Calculate the absolute value of the argument element-wise. |
|
Add the arguments element-wise. |
|
Add the arguments element-wise. |
|
Divide the arguments element-wise. |
|
Divide the arguments element-wise. |
|
Multiply the arguments element-wise. |
|
Multiply the arguments element-wise. |
|
Negate the argument element-wise. |
|
Negate the arguments element-wise. |
|
Raise arguments to power element-wise. |
|
Raise arguments to power element-wise. |
|
Get the signedness of the arguments element-wise. |
|
Subtract the arguments element-wise. |
|
Subtract the arguments element-wise. |
Bit-wise Functions¶
|
Bit-wise AND the arguments element-wise. |
|
Bit-wise negate the arguments element-wise. |
|
Bit-wise OR the arguments element-wise. |
|
Bit-wise XOR the arguments element-wise. |
|
Left shift x by y. |
|
Left shift x by y with invalid shift check. |
|
Right shift x by y. |
|
Right shift x by y with invalid shift check. |
Rounding Functions¶
Rounding functions displace numeric inputs to an approximate value with a simpler representation based on the rounding criterion.
|
Round up to the nearest integer. |
|
Round down to the nearest integer. |
|
Round to a given precision. |
|
Round to a given multiple. |
|
Get the integral part without fractional digits. |
Logarithmic Functions¶
Logarithmic functions are also supported, and also offer _checked
variants which detect domain errors.
|
Compute natural log of arguments element-wise. |
|
Compute natural log of arguments element-wise. |
|
Compute log base 10 of arguments element-wise. |
|
Compute log base 10 of arguments element-wise. |
|
Compute natural log of (1+x) element-wise. |
|
Compute natural log of (1+x) element-wise. |
|
Compute log base 2 of arguments element-wise. |
|
Compute log base 2 of arguments element-wise. |
|
Compute log of x to base b of arguments element-wise. |
|
Compute log of x to base b of arguments element-wise. |
Trigonometric Functions¶
Trigonometric functions are also supported, and also offer _checked
variants which detect domain errors where appropriate.
|
Compute the inverse cosine of the elements argument-wise. |
|
Compute the inverse cosine of the elements argument-wise. |
|
Compute the inverse sine of the elements argument-wise. |
|
Compute the inverse sine of the elements argument-wise. |
|
Compute the principal value of the inverse tangent. |
|
Compute the inverse tangent using argument signs to determine the quadrant. |
|
Compute the cosine of the elements argument-wise. |
|
Compute the cosine of the elements argument-wise. |
|
Compute the sine of the elements argument-wise. |
|
Compute the sine of the elements argument-wise. |
|
Compute the tangent of the elements argument-wise. |
|
Compute the tangent of the elements argument-wise. |
Comparisons¶
These functions expect two inputs of the same type. If one of the inputs is null
they return null
.
|
Compare values for equality (x == y). |
|
Compare values for ordered inequality (x > y). |
|
Compare values for ordered inequality (x >= y). |
|
Compare values for ordered inequality (x < y). |
|
Compare values for ordered inequality (x <= y). |
|
Compare values for inequality (x != y). |
These functions take any number of arguments of a numeric or temporal type.
|
Find the element-wise maximum value. |
|
Find the element-wise minimum value. |
Logical Functions¶
These functions normally emit a null when one of the inputs is null. However, Kleene
logic variants are provided (suffixed _kleene
). See User Guide for details.
|
Logical ‘and’ boolean values. |
|
Logical ‘and’ boolean values (Kleene logic). |
|
Logical ‘and not’ boolean values. |
|
Logical ‘and not’ boolean values (Kleene logic). |
|
Invert boolean values. |
|
Logical ‘or’ boolean values. |
|
Logical ‘or’ boolean values (Kleene logic). |
|
Logical ‘xor’ boolean values. |
String Predicates¶
In these functions an empty string emits false in the output. For ASCII
variants (prefixed ascii_
) a string element with non-ASCII characters
emits false in the output.
The first set of functions emit true if the input contains only characters of a given class.
|
Classify strings as ASCII alphanumeric. |
|
Classify strings as ASCII alphabetic. |
|
Classify strings as ASCII decimal. |
|
Classify strings as ASCII lowercase. |
|
Classify strings as ASCII printable. |
|
Classify strings as ASCII whitespace. |
|
Classify strings as ASCII uppercase. |
|
Classify strings as alphanumeric. |
|
Classify strings as alphabetic. |
|
Classify strings as decimal. |
|
Classify strings as digits. |
|
Classify strings as lowercase. |
|
Classify strings as numeric. |
|
Classify strings as printable. |
|
Classify strings as whitespace. |
|
Classify strings as uppercase. |
The second set of functions also consider the order of characters in the string element.
|
Classify strings as ASCII titlecase. |
|
Classify strings as titlecase. |
The third set of functions examines string elements on a byte-by-byte basis.
|
Classify strings as ASCII. |
String Transforms¶
|
Capitalize the first character of ASCII input. |
|
Transform ASCII input to lowercase. |
|
Reverse ASCII input. |
|
Transform ASCII input lowercase characters to uppercase and uppercase characters to lowercase. |
|
Titlecase each word of ASCII input. |
|
Transform ASCII input to uppercase. |
|
Compute string lengths. |
|
Replace a slice of a binary string with replacement. |
|
Replace non-overlapping substrings that match pattern by replacement. |
|
Replace non-overlapping substrings that match regex pattern by replacement. |
|
Capitalize the first character of input. |
|
Compute UTF8 string lengths. |
|
Transform input to lowercase. |
|
Replace a slice of a string with replacement. |
|
Reverse input. |
|
Transform input lowercase characters to uppercase and uppercase characters to lowercase. |
|
Titlecase each word of input. |
|
Transform input to uppercase. |
String Padding¶
|
For each string in strings, emit a centered string by padding both sides with the given UTF8 codeunit. |
|
For each string in strings, emit a right-aligned string by prepending the given UTF8 codeunit. |
|
For each string in strings, emit a left-aligned string by appending the given UTF8 codeunit. |
|
Center strings by padding with a given character. |
|
Right-align strings by padding with a given character. |
|
Left-align strings by padding with a given character. |
String Trimming¶
|
Trim leading characters present in the characters arguments. |
|
Trim leading ASCII whitespace characters. |
|
Trim trailing characters present in the characters arguments. |
|
Trim trailing ASCII whitespace characters. |
|
Trim leading and trailing characters present in the characters arguments. |
|
Trim leading and trailing ASCII whitespace characters. |
|
Trim leading characters present in the characters arguments. |
|
Trim leading whitespace characters. |
|
Trim trailing characters present in the characters arguments. |
|
Trim trailing whitespace characters. |
|
Trim leading and trailing characters present in the characters arguments. |
|
Trim leading and trailing whitespace characters. |
String Splitting¶
|
Split string according to any ASCII whitespace. |
|
Split string according to separator. |
|
Split string according to regex pattern. |
|
Split string according to any Unicode whitespace. |
String Component Extraction¶
|
Extract substrings captured by a regex pattern. |
String Joining¶
|
Join a list of strings together with a separator to form a single string. |
|
Join string arguments into one, using the last argument as the separator. |
String Slicing¶
|
Slice string . |
Containment Tests¶
|
Count the occurrences of substring pattern in each value of a string array. |
|
Count the non-overlapping matches of regex pattern in each value of a string array. |
|
Match strings against literal pattern. |
|
Find the index of the first occurrence of substring pattern in each value of a string array. |
|
Find the index of the first match of regex pattern in each value of a string array. |
|
Return index of each element in a set of values. |
|
Find each element in a set of values. |
|
Test if the SQL-style LIKE pattern pattern matches a value of a string array. |
|
Test if substring pattern is contained within a value of a string array. |
|
Test if regex pattern matches at any position a value of a string array. |
|
Match strings against literal pattern. |
Categorizations¶
|
Return true if value is finite. |
|
Return true if infinity. |
|
Return true if NaN. |
|
Return true if null (and optionally NaN). |
|
Return true if non-null. |
Selecting / Multiplexing¶
|
Choose values based on multiple conditions. |
|
Given indices and arrays, choose the value from the corresponding array for each index. |
|
Select the first non-null value in each slot. |
|
Choose values based on a condition. |
Conversions¶
|
Cast array values to another data type. |
|
Format temporal values according to a format string. |
|
Parse timestamps. |
Temporal Component Extraction¶
|
Extract day number. |
|
Extract day of the week number. |
|
Extract day of year number. |
|
Extract hour value. |
|
Extract ISO week of year number. |
|
Extract ISO year number. |
|
Extract (ISO year, ISO week, ISO day of week) struct. |
|
Extract microsecond values. |
|
Extract millisecond values. |
|
Extract minute values. |
|
Extract month number. |
|
Extract nanosecond values. |
|
Extract quarter of year number. |
|
Extract second values. |
|
Extract subsecond values. |
|
Extract US week of year number. |
|
Extract week of year number. |
|
Extract year number. |
Temporal Difference¶
|
Compute the number of days and milliseconds between two timestamps. |
|
Compute the number of days between two timestamps. |
|
Compute the number of hours between two timestamps. |
|
Compute the number of microseconds between two timestamps. |
|
Compute the number of millisecond boundaries between two timestamps. |
|
Compute the number of minute boundaries between two timestamps. |
|
Compute the number of months, days and nanoseconds between two timestamps. |
|
Compute the number of months between two timestamps. |
|
Compute the number of nanoseconds between two timestamps. |
|
Compute the number of quarters between two timestamps. |
|
Compute the number of seconds between two timestamps. |
|
Compute the number of weeks between two timestamps. |
|
Compute the number of years between two timestamps. |
Timezone Handling¶
|
Convert naive timestamp to timezone-aware timestamp. |
Associative Transforms¶
|
Dictionary-encode array. |
|
Compute unique elements. |
|
Compute counts of unique elements. |
Selections¶
|
Filter with a boolean selection filter. |
|
Select values from an array based on indices from another array. |
|
Drop nulls from the input. |
|
Select values (or records) from array- or table-like data given boolean filter, where true values are selected. |
|
Select values (or records) from array- or table-like data given integer selection indices. |
Sorts and Partitions¶
|
Return the indices that would sort an array. |
|
Return the indices that would partition an array around a pivot. |
|
Selects the indices of the first k ordered elements from the input. |
|
Return the indices that would sort an array, record batch or table. |
Structural Transforms¶
|
Compute elements using of nested list values using an index. |
|
Flatten list values. |
|
Compute parent indices of nested list values. |
|
Compute list lengths. |
|
Wrap Arrays into a StructArray. |
|
Replace items using a mask and replacement values. |