Documentation
¶
Overview ¶
Package arrow provides utility functions for working with the Apache Arrow compute package.
Index ¶
- func AbsoluteValue(ctx context.Context, arr arrow.Array) (arrow.Array, error)
- func Acos(ctx context.Context, arr arrow.Array) (arrow.Array, error)
- func Add(ctx context.Context, left, right arrow.Array) (arrow.Array, error)
- func AddScalar(ctx context.Context, arr arrow.Array, val interface{}) (arrow.Array, error)
- func Asin(ctx context.Context, arr arrow.Array) (arrow.Array, error)
- func Atan(ctx context.Context, arr arrow.Array) (arrow.Array, error)
- func Cos(ctx context.Context, arr arrow.Array) (arrow.Array, error)
- func Count(ctx context.Context, arr arrow.Array) (int64, error)
- func CountNonNull(ctx context.Context, arr arrow.Array) (int64, error)
- func CreateBooleanArray(mem memory.Allocator, values []bool, validity []bool) *array.Boolean
- func CreateBooleanMask(ctx context.Context, arr arrow.Array, fn func(int) bool) *array.Boolean
- func CreateFloat64Array(mem memory.Allocator, values []float64, validity []bool) *array.Float64
- func CreateInt64Array(mem memory.Allocator, values []int64, validity []bool) *array.Int64
- func CreateStringArray(mem memory.Allocator, values []string, validity []bool) *array.String
- func DatumToArray(datum compute.Datum) arrow.Array
- func DatumToBooleanArray(datum compute.Datum) *array.Boolean
- func DatumToFloat64Array(datum compute.Datum) *array.Float64
- func DatumToInt64Array(datum compute.Datum) *array.Int64
- func DatumToStringArray(datum compute.Datum) *array.String
- func Divide(ctx context.Context, left, right arrow.Array) (arrow.Array, error)
- func DivideScalar(ctx context.Context, arr arrow.Array, val interface{}) (arrow.Array, error)
- func ExtractBooleanValues(arr *array.Boolean) []*bool
- func ExtractFloat64Values(arr *array.Float64) []*float64
- func ExtractInt64Values(arr *array.Int64) []*int64
- func ExtractStringValues(arr *array.String) []*string
- func FilterBetween(ctx context.Context, arr arrow.Array, lower, upper interface{}) (arrow.Array, error)
- func FilterByMask(ctx context.Context, arr arrow.Array, mask *array.Boolean) (arrow.Array, error)
- func FilterEqual(ctx context.Context, arr arrow.Array, value interface{}) (arrow.Array, error)
- func FilterGreaterEqual(ctx context.Context, arr arrow.Array, value interface{}) (arrow.Array, error)
- func FilterGreaterThan(ctx context.Context, arr arrow.Array, value interface{}) (arrow.Array, error)
- func FilterIn(ctx context.Context, arr arrow.Array, values arrow.Array) (arrow.Array, error)
- func FilterIsMultipleOf(ctx context.Context, arr arrow.Array, value interface{}) (arrow.Array, error)
- func FilterLessEqual(ctx context.Context, arr arrow.Array, value interface{}) (arrow.Array, error)
- func FilterLessThan(ctx context.Context, arr arrow.Array, value interface{}) (arrow.Array, error)
- func FilterNotEqual(ctx context.Context, arr arrow.Array, value interface{}) (arrow.Array, error)
- func FilterNotNull(ctx context.Context, arr arrow.Array) (arrow.Array, error)
- func Ln(ctx context.Context, arr arrow.Array) (arrow.Array, error)
- func Log2(ctx context.Context, arr arrow.Array) (arrow.Array, error)
- func Log10(ctx context.Context, arr arrow.Array) (arrow.Array, error)
- func Max(ctx context.Context, arr arrow.Array) (scalar.Scalar, error)
- func Mean(ctx context.Context, arr arrow.Array) (scalar.Scalar, error)
- func Median(ctx context.Context, arr arrow.Array) (scalar.Scalar, error)
- func Min(ctx context.Context, arr arrow.Array) (scalar.Scalar, error)
- func Multiply(ctx context.Context, left, right arrow.Array) (arrow.Array, error)
- func MultiplyScalar(ctx context.Context, arr arrow.Array, val interface{}) (arrow.Array, error)
- func Negate(ctx context.Context, arr arrow.Array) (arrow.Array, error)
- func NthElement(ctx context.Context, arr arrow.Array, n int64, order SortOrder) (scalar.Scalar, error)
- func Power(ctx context.Context, base, exponent arrow.Array) (arrow.Array, error)
- func PowerScalar(ctx context.Context, arr arrow.Array, exponent interface{}) (arrow.Array, error)
- func Quantile(ctx context.Context, arr arrow.Array, q float64) (scalar.Scalar, error)
- func Rank(ctx context.Context, arr arrow.Array, order SortOrder) (arrow.Array, error)
- func Round(ctx context.Context, arr arrow.Array, nDigits int64) (arrow.Array, error)
- func Sign(ctx context.Context, arr arrow.Array) (arrow.Array, error)
- func Sin(ctx context.Context, arr arrow.Array) (arrow.Array, error)
- func Sort(ctx context.Context, arr arrow.Array, order SortOrder) (arrow.Array, error)
- func SortIndicesWithOrder(ctx context.Context, arr arrow.Array, order SortOrder) (*array.Int64, error)
- func StandardDeviation(ctx context.Context, arr arrow.Array) (float64, error)
- func Subtract(ctx context.Context, left, right arrow.Array) (arrow.Array, error)
- func SubtractScalar(ctx context.Context, arr arrow.Array, val interface{}) (arrow.Array, error)
- func Sum(ctx context.Context, arr arrow.Array) (scalar.Scalar, error)
- func Take(ctx context.Context, arr arrow.Array, indices arrow.Array) (arrow.Array, error)
- func TakeWithIndices(ctx context.Context, arr arrow.Array, indices *array.Int64) (arrow.Array, error)
- func Tan(ctx context.Context, arr arrow.Array) (arrow.Array, error)
- func Unique(ctx context.Context, arr arrow.Array) (arrow.Array, error)
- func UniqueValues(ctx context.Context, arr arrow.Array) (arrow.Array, error)
- func Variance(ctx context.Context, arr arrow.Array) (float64, error)
- type MinMaxResult
- type QuantileOpts
- type SortIndicesOptions
- type SortOrder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AbsoluteValue ¶
AbsoluteValue computes the absolute value of each element in the array. Returns the resulting array and any error encountered.
func Acos ¶
Acos computes the arccosine of each element in the array. Returns the resulting array and any error encountered.
func Add ¶
Add performs element-wise addition of two arrays. Returns the resulting array and any error encountered.
func AddScalar ¶
AddScalar performs element-wise addition of an array and a scalar. Returns the resulting array and any error encountered.
func Asin ¶
Asin computes the arcsine of each element in the array. Returns the resulting array and any error encountered.
func Atan ¶
Atan computes the arctangent of each element in the array. Returns the resulting array and any error encountered.
func Cos ¶
Cos computes the cosine of each element in the array. Returns the resulting array and any error encountered.
func Count ¶
Count counts the number of elements in an array. Returns the count as an int64 and any error encountered.
func CountNonNull ¶
CountNonNull counts the number of non-null elements in an array. Returns the count as an int64 and any error encountered.
func CreateBooleanArray ¶
CreateBooleanArray creates a BooleanArray with the given values and validity.
func CreateBooleanMask ¶
CreateBooleanMask creates a boolean mask from a function that evaluates each element. The function should take an index and return a boolean value. Returns the boolean mask array.
func CreateFloat64Array ¶
CreateFloat64Array creates a Float64Array with the given values and validity.
func CreateInt64Array ¶
CreateInt64Array creates an Int64Array with the given values and validity.
func CreateStringArray ¶
CreateStringArray creates a StringArray with the given values and validity.
func DatumToArray ¶
DatumToArray converts a compute.Datum to an arrow.Array. Returns nil if the conversion is not possible.
func DatumToBooleanArray ¶
DatumToBooleanArray converts a compute.Datum to an *array.Boolean. Returns nil if the conversion is not possible.
func DatumToFloat64Array ¶
DatumToFloat64Array converts a compute.Datum to an *array.Float64. Returns nil if the conversion is not possible.
func DatumToInt64Array ¶
DatumToInt64Array converts a compute.Datum to an *array.Int64. Returns nil if the conversion is not possible.
func DatumToStringArray ¶
DatumToStringArray converts a compute.Datum to an *array.String. Returns nil if the conversion is not possible.
func Divide ¶
Divide performs element-wise division of two arrays. Returns the resulting array and any error encountered.
func DivideScalar ¶
DivideScalar performs element-wise division of an array and a scalar. Returns the resulting array and any error encountered.
func ExtractBooleanValues ¶
ExtractBooleanValues extracts the values from a BooleanArray into a slice. Null values are represented as nil in the returned slice.
func ExtractFloat64Values ¶
ExtractFloat64Values extracts the values from a Float64Array into a slice. Null values are represented as nil in the returned slice.
func ExtractInt64Values ¶
ExtractInt64Values extracts the values from an Int64Array into a slice. Null values are represented as nil in the returned slice.
func ExtractStringValues ¶
ExtractStringValues extracts the values from a StringArray into a slice. Null values are represented as nil in the returned slice.
func FilterBetween ¶
func FilterBetween(ctx context.Context, arr arrow.Array, lower, upper interface{}) (arrow.Array, error)
FilterBetween filters an array to include only elements between the specified lower and upper bounds (inclusive). Returns the filtered array and any error encountered.
func FilterByMask ¶
FilterByMask filters an array using a boolean mask. Returns the filtered array and any error encountered.
func FilterEqual ¶
FilterEqual filters an array to include only elements equal to the specified value. Returns the filtered array and any error encountered.
func FilterGreaterEqual ¶
func FilterGreaterEqual(ctx context.Context, arr arrow.Array, value interface{}) (arrow.Array, error)
FilterGreaterEqual filters an array to include only elements greater than or equal to the specified value. Returns the filtered array and any error encountered.
func FilterGreaterThan ¶
func FilterGreaterThan(ctx context.Context, arr arrow.Array, value interface{}) (arrow.Array, error)
FilterGreaterThan filters an array to include only elements greater than the specified value. Returns the filtered array and any error encountered.
func FilterIn ¶
FilterIn filters an array to include only elements that are in the specified values array. Returns the filtered array and any error encountered.
func FilterIsMultipleOf ¶
func FilterIsMultipleOf(ctx context.Context, arr arrow.Array, value interface{}) (arrow.Array, error)
FilterIsMultipleOf filters an array to include only elements that are multiples of the specified value. Returns the filtered array and any error encountered.
func FilterLessEqual ¶
FilterLessEqual filters an array to include only elements less than or equal to the specified value. Returns the filtered array and any error encountered.
func FilterLessThan ¶
FilterLessThan filters an array to include only elements less than the specified value. Returns the filtered array and any error encountered.
func FilterNotEqual ¶
FilterNotEqual filters an array to include only elements not equal to the specified value. Returns the filtered array and any error encountered.
func FilterNotNull ¶
FilterNotNull filters an array to include only non-null elements. Returns the filtered array and any error encountered.
func Ln ¶
Ln computes the natural logarithm of each element in the array. Returns the resulting array and any error encountered.
func Log2 ¶
Log2 computes the base-2 logarithm of each element in the array. Returns the resulting array and any error encountered.
func Log10 ¶
Log10 computes the base-10 logarithm of each element in the array. Returns the resulting array and any error encountered.
func Max ¶
Max finds the maximum value in an array. Returns the resulting scalar and any error encountered.
func Mean ¶
Mean calculates the arithmetic mean of all elements in an array. Returns the resulting scalar and any error encountered.
func Median ¶
Median calculates the median of the elements in an array. Returns the median value and any error encountered.
func Min ¶
Min finds the minimum value in an array. Returns the resulting scalar and any error encountered.
func Multiply ¶
Multiply performs element-wise multiplication of two arrays. Returns the resulting array and any error encountered.
func MultiplyScalar ¶
MultiplyScalar performs element-wise multiplication of an array and a scalar. Returns the resulting array and any error encountered.
func Negate ¶
Negate computes the negation of each element in the array. Returns the resulting array and any error encountered.
func NthElement ¶
func NthElement(ctx context.Context, arr arrow.Array, n int64, order SortOrder) (scalar.Scalar, error)
NthElement returns the nth element of the sorted array. Returns the scalar value and any error encountered.
func Power ¶
Power raises each element in the base array to the power of the corresponding element in the exponent array. Returns the resulting array and any error encountered.
func PowerScalar ¶
PowerScalar raises each element in the array to the power of the scalar value. Returns the resulting array and any error encountered.
func Quantile ¶
Quantile calculates the quantile of the elements in an array. The quantile parameter should be between 0 and 1. Returns the quantile value and any error encountered.
func Rank ¶
Rank returns an array with the rank of each element in the input array. Returns a new Int64Array with the ranks and any error encountered.
func Round ¶
Round rounds each element in the array to the specified number of decimal places. Returns the resulting array and any error encountered.
func Sign ¶
Sign returns the sign of each element in the array (-1, 0, or 1). Returns the resulting array and any error encountered.
func Sin ¶
Sin computes the sine of each element in the array. Returns the resulting array and any error encountered.
func Sort ¶
Sort returns a new array with the elements sorted. Returns a new array of the same type as the input and any error encountered.
func SortIndicesWithOrder ¶
func SortIndicesWithOrder(ctx context.Context, arr arrow.Array, order SortOrder) (*array.Int64, error)
SortIndicesWithOrder returns the indices that would sort the array according to the specified order. Returns an Int64Array containing the indices and any error encountered.
func StandardDeviation ¶
StandardDeviation calculates the standard deviation of the elements in an array. Returns the standard deviation as a float64 and any error encountered.
func Subtract ¶
Subtract performs element-wise subtraction of two arrays. Returns the resulting array and any error encountered.
func SubtractScalar ¶
SubtractScalar performs element-wise subtraction of an array and a scalar. Returns the resulting array and any error encountered.
func Sum ¶
Sum calculates the sum of all elements in an array. Returns the resulting scalar and any error encountered.
func Take ¶
Take selects elements from an array based on the provided indices. Returns the resulting array and any error encountered.
func TakeWithIndices ¶
func TakeWithIndices(ctx context.Context, arr arrow.Array, indices *array.Int64) (arrow.Array, error)
TakeWithIndices returns a new array with elements taken from the input array at the specified indices. Returns a new array of the same type as the input and any error encountered.
func Tan ¶
Tan computes the tangent of each element in the array. Returns the resulting array and any error encountered.
func Unique ¶
Unique returns the unique values in an array. Returns the resulting array and any error encountered.
func UniqueValues ¶
UniqueValues returns a new array with duplicate elements removed. Returns a new array of the same type as the input and any error encountered.
Types ¶
type MinMaxResult ¶
MinMaxResult contains the min and max scalars.
type QuantileOpts ¶
QuantileOpts implements compute.FunctionOptions for the quantile function
func (*QuantileOpts) TypeName ¶
func (o *QuantileOpts) TypeName() string
TypeName implements the compute.FunctionOptions interface
type SortIndicesOptions ¶
type SortIndicesOptions struct {
Descending bool
}
SortIndicesOptions implements compute.FunctionOptions for the sort_indices function
func (*SortIndicesOptions) TypeName ¶
func (o *SortIndicesOptions) TypeName() string
TypeName implements the compute.FunctionOptions interface