SciDB Functions

Table of All Functions

The following table lists the current functions available in SciDB expressions. The third column indicates which library contains that function.  Where functions have individual pages, click the link to access those pages. For additional info on other functions, run: list('functions').

Function NameDescription Library
% Remainder.scidb

*

Multiplication.scidb
+Addition.scidb
-Subtraction or additive inverse.scidb
/Division.scidb
<Less than.scidb
<=Less than or equal to.scidb
<>Not equal.scidb
=Equal.scidb
>Greater than.scidb
>=Greater than or equal to.scidb
absAbsolute value.scidb
acosInverse (arc) cosine in radians.scidb
allzerosReturn a zero-values timestamp.timeseries
and
Infix logical AND.scidb
append_offsetAppends a GMT offset in seconds to a datetime attribute, yielding a datetimetz value.scidb
apply_offset Converts a GMT datetime to local datetime by subtracting the offset timezone value, and stores the result as datetimetz including the offset timezone value.scidb
asinInverse (arc) sine in radians.scidb
atanInverse (arc) tangent in radians.scidb
binomcdfBinomial cummulative distribution function. linear algebra
ceilRound to next larger whole integer.scidb
chi2cdfChi-squared cumulative distribution function.linear algebra
cosCosine, input in radians.scidb
current_date Current date value.timeseries
current_time Current time value.timeseries
current_timestampCurrent timestamp value.timeseries
date_dtDay of a date value.timeseries
date_fm Datatype conversion. timeseries
day_of_week Returns an integer alue representing the day of the week: 0 (Sunday) through 6 (Saturday).scidb
day_ts Day of a timestamp value.timeseries
days_i Days of an interval value.timeseries
exp Exponential function.scidb
extract_dt Extract a field you supply from a date value.timeseries
extract_i Extract a field you supply from an interval value.timeseries
extract_tm Extract a field you supply from a time value.timeseries
extract_ts Extract a field you supply from a timestamp value.timeseries
first_index The initial dimension value of the supplied dimension. This function takes two arguments: array name as a string, and optionally, dimension name as a string.scidb
floor Round to the next-lowest integer.scidb
format_dt Apply a format string to a date value.timeseries
format_i Apply a format sting to an interval value.timeseries
format_tm Apply a format string to a time value.timeseries
format_ts Apply a format string to a timestamp value.timeseries
gcd_hf Great circle distance, Haversine formula. linear algebra
gcd_slc Great circle distance, spherical law of cosines. linear algebra
gcd_vif Great circle distance, Vincenty formula. linear algebra
geomcdf Geometric cumulative distribution function. linear algebra
get_offset Returns the timezone offset, in seconds. scidb
high Returns the maximum dimension value where the cell is is non-empty. This function takes two arguments: array name as a string, and optionally, dimension name as a string. scidb
hour_i Hour of an interval value. timeseries
hour_of_day Extracts the hour from a datetime attribute. scidb
hour_tm Hour of a time value. timeseries
hour_ts Hour of a timestamp value. timeseries
hygecdf Hypergeometric cumulative distribution function linear algebra
hygepmf Hypergeometric probability mass function. linear algebra
hygequant Hypergeometric quantile function. linear algebra
ibinomcdf Inverse binomial cumulative distribution function. linear algebra
ichi2cdf Inverse chi-squared cumulative distribution function.  linear algebra
igeomcdf Inverse geometric cumulative distribution function. linear algebra
ihygecdf Inverse hypergeometric cumulative distribution function. linear algebra
iif Inline if: iif(expression, value_if_true, value_otherwise).scidb
inegbinomcdf Inverse negative binomial cumulative distribution function. linear algebra
inormcdf Inverse normal cumulative distribution function. linear algebra
instanceid Returns the instance ID (int64) of the SciDB instance on which it is run.  SciDB arrays are spread across some or all of the instances in the SciDB cluster. Thus, you can use the instanceid function to determine where the chunks of an array are stored. scidb
interval Datatype conversion. timeseries
is_nanIs NaN (not a number).scidb
is_null Is NULL.scidb
itcdf Inverse student's t-distribution cumulative distribution function. linear algebra
last_index The final dimension value of the supplied dimension. This function takes two arguments: array name as a string, and optionally, dimension name as a string. scidb
length Returns the size of the supplied dimension. This function takes two arguments: array name as a string, and optionally, dimension name as a string. scidb
localtime The local time. timeseries
localtimestamp The timestamp, based on the local timezone. timeseries
log Natural logarithm. scidb
log10 Base-10 logarithm. scidb
lowReturns the minimum dimension value where the cell is is non-empty. This function takes two arguments: array name as a string, and optionally, dimension name as a string. scidb
make_dt Returns a date value, assembled from individual values for year, month, and day. timeseries
make_i

Returns an interval value, assembled from days, hours, minutes, seconds, and microseconds.
OR
Returns an interval value, assembled from an integer and a unit: the unit can be 'sec', 'min', 'hour', or 'day'.
OR
Returns an interval value, assembled from hours, minutes, seconds, and microseconds.

timeseries
make_tm Returns a time value, assembled from individual values for hour, minutes, second, and microsecond. timeseries
make_ts Returns a timestamp value, assembled from individual values for year, month, day, hour, minute, second, and microsecond.
OR
Returns a timestamp value, assembled from a date value and a time value.
timeseries
max

Does not do what the name suggests.  To find the maximum of two values, use iif(a > b, a, b) .

  • With two bool arguments, it returns their logical OR.  Use the infix 393609217 instead.
  • With two string arguments, it returns the string that is higher in the ASCII collating sequence.
 scidb
min

Does not do what the name suggests.  To find the minimum of two values, use iif(a < b, a, b) .

  • With two bool arguments, it returns their logical AND.  Use the infix 393609217 instead.
  • With two string arguments, it returns the string that is lower in the ASCII collating sequence.
scidb
min_i Minutes of an interval value. timeseries
min_tm Minutes of a time value. timeseries
min_ts Minute of a timestamp value. timeseries
missing Converts an int32 value into a NULL value with that missing reason code.  Valid values must be in the range 0 ≤ x < 128.  scidb
missing_reasonReturns the missing reason code for a value, or -1 if the value is not missing. scidb
month_dt Month of a date value. timeseries
month_ts Month of a timestamp value. timeseries
msec_i Milliseconds of an interval value. timeseries
msec_tm Milliseconds of a time value. timeseries
msec_ts Milliseconds of a timestamp value. timeseries
negbinomcdf Negative binomial cumulative distribution function. linear algebra
normcdf Normal cumulative distribution function. linear algebra
not Boolean NOT. scidb
now Returns the current date and time. scidb
now_dt The current date. timeseries
now_tm The current time. timeseries
now_ts The current timestamp. timeseries
or
Infix logical OR. scidb
pow Raise to a power: pow(base,exponent). scidb
random Generate random positive integer. The maximum value is the maximum signed 32-bit integer: 2,147,483,647 scidb
regex Regular expression matching function regex(string_attribute, pattern). Uses the regular expression language from the Boost library. Returns true on a match. scidb
scan_dt Interpret input string according to the format and convert to a datetime: scan_dt(format, input).timeseries
scan_i Interpret input string according to the format and convert to a time interval: scan_i(format, input).timeseries
scan_tm Interpret input string according to the format and convert to a struct tm time value: scan_tm(format, input).
timeseries
scan_ts Interpret input string according to the format and convert to a timestamp value: scan_ts(format, input). timeseries
sec_i Seconds of an interval value. timeseries
sec_tm Seconds of a time value. timeseries
sec_ts Seconds of a timestamp value. timeseries
sin Sine function. scidb
sizeofReturns size of its argument data object in bytes, as a uint64.scidb
sqrt Square root. scidb
strftime Returns the formatted date and time, based on the formatting options that you pass to the function. The format string is as for the Linux strftime function. scidb
strftime_dt Returns the formatted date, based on the formatting options that you pass to the function. The format string is as for the Linux strftime function. timeseries
strftime_tm Returns the formatted time, based on the formatting options that you pass to the function. The format string is as for the Linux strftime function. timeseries
strftime_ts Returns the formatted timestamp, based on the formatting options that you pass to the function. The format string is as for the Linux strftime function. timeseries
strip_offset Returns the datetime value, after stripping the timezone offset from a datetimetz argument. scidb
strlen Returns the string length as an int32. scidb
substr Returns a substring of a string you supply:  substr(the_string, start, end). scidb
tan Tangent. scidb
tcdf Student's t cumulative distribution function. linear algebra
time Datatype conversion. timeseries
time_fm Datatype conversion. timeseries
timestamp Datatype conversion. timeseries
timestamp_fm Datatype conversion. timeseries
today_dt The current date. timeseries
today_ts The current timestamp. timeseries
togmt Converts a datetimetz to a datetime, adding in the timezone offset to return the GMT date and time that corresponds to the input. scidb
tomorrow_dt Tomorrow's date. timeseries
tomorrow_ts Tomorrow's timestamp. timeseries
tznow Returns the current date and time as a datetimetz. scidb
usec_i Microseconds of an interval value. timeseries
usec_tm Microseconds of a time value. timeseries
usec_ts Microsecond of a timestamp value. timeseries
wday_dt Weekday of a date value. timeseries
wday_ts Weekday of a timestamp value. timeseries
yday_dt Julian date of a date value. timeseries
yday_ts Julian date of a timestamp value. timeseries
year_dt Year of a date value. timeseries
year_ts Year of a timestamp value. timeseries
yesterday_dt Yesterday's date. timeseries
yesterday_ts Yesterday's timestamp. timeseries