1.8
User Documentation for MADlib
array_ops.sql_in File Reference

implementation of array operations in SQL More...

Functions

anyarray array_add (anyarray x, anyarray y)
 Adds two arrays. It requires that all the values are NON-NULL. Return type is the same as the input type. More...
 
aggregate anyarray sum (anyarray)
 Aggregate, element-wise sum of arrays. It requires that all the values are NON-NULL. Return type is the same as the input type. More...
 
anyarray array_sub (anyarray x, anyarray y)
 Subtracts two arrays. It requires that all the values are NON-NULL. Return type is the same as the input type. More...
 
anyarray array_mult (anyarray x, anyarray y)
 Element-wise product of two arrays. It requires that all the values are NON-NULL. Return type is the same as the input type. More...
 
anyarray array_div (anyarray x, anyarray y)
 Element-wise division of two arrays. It requires that all the values are NON-NULL. Return type is the same as the input type. More...
 
float8 array_dot (anyarray x, anyarray y)
 Dot-product of two arrays. It requires that all the values are NON-NULL. Return type is the same as the input type. More...
 
bool array_contains (anyarray x, anyarray y)
 Checks whether one array contains the other. This function returns TRUE if each non-zero element in the right array equals to the element with the same index in the left array. More...
 
anyelement array_max (anyarray x)
 This function finds the maximum value in the array. NULLs are ignored. Return type is the same as the input type. More...
 
float8[] array_max_index (anyarray x)
 This function finds the maximum value and corresponding index in the array. NULLs are ignored. Return type is the same as the input type. More...
 
anyelement array_min (anyarray x)
 This function finds the minimum value in the array. NULLs are ignored. Return type is the same as the input type. More...
 
float8[] array_min_index (anyarray x)
 This function finds the minimum value and corresponding index in the array. NULLs are ignored. Return type is the same as the input type. More...
 
anyelement array_sum (anyarray x)
 This function finds the sum of the values in the array. NULLs are ignored. Return type is the same as the input type. More...
 
float8 array_sum_big (anyarray x)
 This function finds the sum of the values in the array. NULLs are ignored. Return type is always FLOAT8 regardless of input. This function is meant to replace array_sum() in the cases when sum may overflow the element type. More...
 
float8 array_mean (anyarray x)
 This function finds the mean of the values in the array. NULLs are ignored. More...
 
float8 array_stddev (anyarray x)
 This function finds the standard deviation of the values in the array. NULLs are ignored. More...
 
float8[] array_of_float (integer k)
 This function creates an array of set size (the argument value) of FLOAT8, initializing the values to 0.0;. More...
 
bigint[] array_of_bigint (integer k)
 This function creates an array of set size (the argument value) of BIGINT, initializing the values to 0;. More...
 
anyarray array_fill (anyarray x, anyelement k)
 This functions set every values in the array to some desired value (provided as the argument). More...
 
anyarray array_scalar_mult (anyarray x, anyelement k)
 This function takes an array as the input and executes element-wise multiplication by the scalar provided as the second argument, returning the resulting array. It requires that all the values are NON-NULL. Return type is the same as the input type. More...
 

Detailed Description

Date
April 2011

Function Documentation

anyarray array_add ( anyarray  x,
anyarray  y 
)
Parameters
xArray x
yArray y
Returns
Sum of x and y.
bool array_contains ( anyarray  x,
anyarray  y 
)
Parameters
xArray x
yArray y
Returns
Returns true if x contains y.
anyarray array_div ( anyarray  x,
anyarray  y 
)
Parameters
xArray x
yArray y
Returns
Element-wise division of x and y.
float8 array_dot ( anyarray  x,
anyarray  y 
)
Parameters
xArray x
yArray y
Returns
Dot-product of x and y.
anyarray array_fill ( anyarray  x,
anyelement  k 
)
Parameters
xSome array
kDesired value
Returns
Fills array with desired value.
anyelement array_max ( anyarray  x)
Parameters
xArray x
Returns
Max of x.
float8 [] array_max_index ( anyarray  x)
Parameters
xArray x
Returns
Array as [max, index].
float8 array_mean ( anyarray  x)
Parameters
xArray x
Returns
Mean of x.
anyelement array_min ( anyarray  x)
Parameters
xArray x
Returns
Min of x.
float8 [] array_min_index ( anyarray  x)
Parameters
xArray x
Returns
Array as [min, index].
anyarray array_mult ( anyarray  x,
anyarray  y 
)
Parameters
xArray x
yArray y
Returns
Element-wise product of x and y.
bigint [] array_of_bigint ( integer  k)
Parameters
kArray size.
Returns
Array of size k.
float8 [] array_of_float ( integer  k)
Parameters
kArray size
Returns
Array of size k.
anyarray array_scalar_mult ( anyarray  x,
anyelement  k 
)
Parameters
xArray x
kScalar
Returns
Array with each element of x multiplied by scalar.
float8 array_stddev ( anyarray  x)
Parameters
xArray x
Returns
Standard deviation of x.
anyarray array_sub ( anyarray  x,
anyarray  y 
)
Parameters
xArray x
yArray y
Returns
x-y.
anyelement array_sum ( anyarray  x)
Parameters
xArray x
Returns
Sum of x.
float8 array_sum_big ( anyarray  x)
Parameters
xArray x
Returns
Sum of x.
aggregate anyarray sum ( anyarray  )
Parameters
xArray x
yArray y
Returns
Sum of x and y.