Module compute
Expand description
Computation kernels on Arrow Arrays
Modules§
- kernels
- Computation kernels on Arrow Arrays
Structs§
- Cast
Options - CastOptions provides a way to override the default cast behaviors
- Filter
Builder - A builder to construct
FilterPredicate
- Filter
Predicate - A filtering predicate that can be applied to an [
Array
] - Lexicographical
Comparator - A lexicographical comparator that wraps given array data (columns) and can lexicographically compare data at given two indices. The lifetime is the same at the data wrapped.
- Partitions
- A computed set of partitions, see
partition
- Slices
Iterator - An iterator of
(usize, usize)
each representing an interval[start, end)
whose slots of a bitmap [Buffer] are true. - Sort
Column - One column to be used in lexicographical sort
- Sort
Options - Options that define the sort order of a given column
- Take
Options - Options that define how
take
should behave
Enums§
- Date
Part - Valid parts to extract from date/time/timestamp arrays.
Traits§
- String
Array Type - A trait for Arrow String Arrays, currently three types are supported:
Functions§
- and
- Performs
AND
operation on two arrays. If either left or right value is null then the result is also null. - and_
kleene - Logical ‘and’ boolean values with Kleene logic
- and_not
- Performs
AND_NOT
operation on two arrays. If either left or right value is null then the result is also null. - binary
- Allies a binary infallable function to two [
PrimitiveArray
]s, producing a new [PrimitiveArray
] - binary_
mut - Applies a binary and infallible function to values in two arrays, replacing the values in the first array in place.
- bit_and
- Returns the bitwise and of all non-null input values.
- bit_or
- Returns the bitwise or of all non-null input values.
- bit_xor
- Returns the bitwise xor of all non-null input values.
- bool_
and - Returns true if all non-null input values are true, otherwise false.
- bool_or
- Returns true if any non-null input value is true, otherwise false.
- build_
filter Deprecated - Returns a prepared function optimized to filter multiple arrays.
- can_
cast_ types - Return true if a value of type
from_type
can be cast into a value ofto_type
. - cast
- Cast
array
to the provided data type and return a new Array with typeto_type
, if possible. - cast_
with_ options - Try to cast
array
toto_type
if possible. - concat
- Concatenate multiple [Array] of the same type into a single [ArrayRef].
- concat_
batches - Concatenates
batches
together into a single [RecordBatch
]. - contains
- Perform SQL
CONTAINS(left, right)
- date_
part - Given an array, return a new array with the extracted
DatePart
as signed 32-bit integer values. - day
Deprecated - Extracts the day of a given temporal primitive array as an array of integers
- day_dyn
Deprecated - Extracts the day of a given temporal array as an array of integers.
- doy
Deprecated - Extracts the day of year of a given temporal primitive array as an array of integers.
- doy_dyn
Deprecated - Extracts the day of year of a given temporal array as an array of integers.
- ends_
with - Perform SQL
ENDSWITH(left, right)
- filter
- Returns a filtered
values
[Array] where the corresponding elements ofpredicate
aretrue
. - filter_
record_ batch - Returns a filtered [RecordBatch] where the corresponding elements of
predicate
are true. - hour
Deprecated - Extracts the hours of a given temporal primitive array as an array of integers within the range of [0, 23].
- hour_
dyn Deprecated - Extracts the hours of a given array as an array of integers within
the range of [0, 23]. If the given array isn’t temporal primitive or dictionary array,
an
Err
will be returned. - ilike
- Perform SQL
left ILIKE right
- in_list
- Checks if a [
GenericListArray
] contains a value in the [PrimitiveArray
] - in_
list_ utf8 - Checks if a [
GenericListArray
] contains a value in the [GenericStringArray
] - interleave
- Takes elements by index from a list of [
Array
], creating a new [Array
] from those values. - interleave_
record_ batch - Interleave rows by index from multiple [
RecordBatch
] instances and return a new [RecordBatch
]. - is_
not_ null - Returns a non-null [BooleanArray] with whether each value of the array is not null.
- is_null
- Returns a non-null [BooleanArray] with whether each value of the array is null.
- lexsort
- Sort a list of
ArrayRef
usingSortOptions
provided for each array. - lexsort_
to_ indices - Sort elements lexicographically from a list of
ArrayRef
into an unsigned integer (UInt32Array
) of indices. - like
- Perform SQL
left LIKE right
- max
- Returns the maximum value in the array, according to the natural order. For floating point arrays any NaN values are considered to be greater than any other non-null value
- max_
array - Returns the max of values in the array of
ArrowNumericType
type, or dictionary array with value ofArrowNumericType
type. - max_
binary - Returns the maximum value in the binary array, according to the natural order.
- max_
binary_ view - Returns the maximum value in the binary view array, according to the natural order.
- max_
boolean - Returns the maximum value in the boolean array
- max_
string - Returns the maximum value in the string array, according to the natural order.
- max_
string_ view - Returns the maximum value in the string view array, according to the natural order.
- microsecond
Deprecated - Extracts the microseconds of a given temporal primitive array as an array of integers
- microsecond_
dyn Deprecated - Extracts the microseconds of a given temporal primitive array as an array of integers.
If the given array isn’t temporal primitive or dictionary array,
an
Err
will be returned. - millisecond
Deprecated - Extracts the milliseconds of a given temporal primitive array as an array of integers
- millisecond_
dyn Deprecated - Extracts the milliseconds of a given temporal primitive array as an array of integers.
If the given array isn’t temporal primitive or dictionary array,
an
Err
will be returned. - min
- Returns the minimum value in the array, according to the natural order. For floating point arrays any NaN values are considered to be greater than any other non-null value
- min_
array - Returns the min of values in the array of
ArrowNumericType
type, or dictionary array with value ofArrowNumericType
type. - min_
binary - Returns the minimum value in the binary array, according to the natural order.
- min_
binary_ view - Returns the minimum value in the binary view array, according to the natural order.
- min_
boolean - Returns the minimum value in the boolean array.
- min_
string - Returns the minimum value in the string array, according to the natural order.
- min_
string_ view - Returns the minimum value in the string view array, according to the natural order.
- minute
Deprecated - Extracts the minutes of a given temporal primitive array as an array of integers
- minute_
dyn Deprecated - Extracts the minutes of a given temporal array as an array of integers.
If the given array isn’t temporal primitive or dictionary array,
an
Err
will be returned. - month
Deprecated - Extracts the month of a given temporal primitive array as an array of integers within the range of [1, 12].
- month_
dyn Deprecated - Extracts the month of a given temporal array as an array of integers.
If the given array isn’t temporal primitive or dictionary array,
an
Err
will be returned. - multiply_
fixed_ point - Perform
left * right
operation on two decimal arrays. If either left or right value is null then the result is also null. - multiply_
fixed_ point_ checked - Perform
left * right
operation on two decimal arrays. If either left or right value is null then the result is also null. - multiply_
fixed_ point_ dyn - Perform
left * right
operation on two decimal arrays. If either left or right value is null then the result is also null. - nanosecond
Deprecated - Extracts the nanoseconds of a given temporal primitive array as an array of integers
- nanosecond_
dyn Deprecated - Extracts the nanoseconds of a given temporal primitive array as an array of integers.
If the given array isn’t temporal primitive or dictionary array,
an
Err
will be returned. - nilike
- Perform SQL
left NOT ILIKE right
- nlike
- Perform SQL
left NOT LIKE right
- not
- Performs unary
NOT
operation on an arrays. If value is null then the result is also null. - nullif
- Returns a new array with the same values and the validity bit to false where
the corresponding element of
right
is true. - num_
days_ from_ monday Deprecated - Extracts the day of week of a given temporal primitive array as an array of integers.
- num_
days_ from_ monday_ dyn Deprecated - Extracts the day of week of a given temporal array as an array of integers.
- num_
days_ from_ sunday Deprecated - Extracts the day of week of a given temporal primitive array as an array of integers, starting at Sunday.
- num_
days_ from_ sunday_ dyn Deprecated - Extracts the day of week of a given temporal array as an array of integers, starting at Sunday.
- or
- Performs
OR
operation on two arrays. If either left or right value is null then the result is also null. - or_
kleene - Logical ‘or’ boolean values with Kleene logic
- partial_
sort - It’s unstable_sort, may not preserve the order of equal elements
- partition
- Given a list of lexicographically sorted columns, computes the
Partitions
, where a partition consists of the set of consecutive rows with equal values - prep_
null_ mask_ filter - Remove null values by do a bitmask AND operation with null bits and the boolean bits.
- quarter
Deprecated - Extracts the quarter of a given temporal primitive array as an array of integers within the range of [1, 4].
- quarter_
dyn Deprecated - Extracts the quarter of a given temporal array as an array of integersa within
the range of [1, 4]. If the given array isn’t temporal primitive or dictionary array,
an
Err
will be returned. - rank
- Assigns a rank to each value in
array
based on its position in the sorted order - regexp_
is_ match - Return BooleanArray indicating which strings in an array match an array of regular expressions.
- regexp_
is_ match_ scalar - Return BooleanArray indicating which strings in an array match a single regular expression.
- regexp_
is_ match_ utf8 Deprecated - Perform SQL
array ~ regex_array
operation on [StringArray
] / [LargeStringArray
]. Ifregex_array
element has an empty value, the corresponding result value is always true. - regexp_
is_ match_ utf8_ scalar Deprecated - Perform SQL
array ~ regex_array
operation on [StringArray
] / [LargeStringArray
] and a scalar. - regexp_
match - Extract all groups matched by a regular expression for a given String array.
- second
Deprecated - Extracts the seconds of a given temporal primitive array as an array of integers
- second_
dyn Deprecated - Extracts the seconds of a given temporal array as an array of integers.
If the given array isn’t temporal primitive or dictionary array,
an
Err
will be returned. - shift
- Shifts array by defined number of items (to left or right)
A positive value for
offset
shifts the array to the right a negative value shifts the array to the left. - sort
- Sort the
ArrayRef
usingSortOptions
. - sort_
limit - Sort the
ArrayRef
partially. - sort_
to_ indices - Sort elements from
ArrayRef
into an unsigned integer (UInt32Array
) of indices. Floats are sorted using IEEE 754 totalOrder.limit
is an option for partial_sort. - starts_
with - Perform SQL
STARTSWITH(left, right)
- sum
- Returns the sum of values in the primitive array.
- sum_
array - Returns the sum of values in the array.
- sum_
array_ checked - Returns the sum of values in the array.
- sum_
checked - Returns the sum of values in the primitive array.
- take
- Take elements by index from [Array], creating a new [Array] from those indexes.
- take_
arrays - For each [ArrayRef] in the
Vec<ArrayRef>
, take elements by index and create a newVec<ArrayRef>
from those indices. - take_
record_ batch - Take rows by index from [
RecordBatch
] and returns a new [RecordBatch
] from those indexes. - try_
binary - Applies the provided fallible binary operation across
a
andb
. - try_
binary_ mut - Applies the provided fallible binary operation across
a
andb
by mutating the mutable [PrimitiveArray
]a
with the results. - try_
unary - See [
PrimitiveArray::try_unary
] - try_
unary_ mut - See [
PrimitiveArray::try_unary_mut
] - unary
- See [
PrimitiveArray::unary
] - unary_
mut - See [
PrimitiveArray::unary_mut
] - union_
extract - Returns the value of the target field when selected, or NULL otherwise.
- week
Deprecated - Extracts the week of a given temporal primitive array as an array of integers
- week_
dyn Deprecated - Extracts the week of a given temporal array as an array of integers.
If the given array isn’t temporal primitive or dictionary array,
an
Err
will be returned. - year
Deprecated - Extracts the years of a given temporal primitive array as an array of integers
- year_
dyn Deprecated - Extracts the years of a given temporal array as an array of integers.
If the given array isn’t temporal primitive or dictionary array,
an
Err
will be returned.
Type Aliases§
- Filter
Deprecated - Function that can filter arbitrary arrays