Special Values for Attributes

SciDB attributes and cells support the following types of values:

  • Ordinary values. These lie within a defined range of representable values for the attribute type. For example, "123" is an ordinary value for the data type int64.
  • Null (missing) values. These match the semantics of NULL in a relational database. Null values can contain a missing reason code. This allows applications to optionally specify multiple types of null values and treat each type differently. When loading data, you can specify a null value with a missing reason code by using "?n", where n is an integer from 0 to 127. There are two SciDB functions that are associated with missing value codes: missing() and missing_reason().
    For clarity throughout the document the term "null" is equivalent to "?0", that is, a missing value with missing reason code 0. All other missing values are specified with the corresponding missing value code, e.g. "missing value code 100" will be represented by "?100".
  • Empty cells. When you create an array that is very sparse, most of its cells are empty. In most cases, SciDB treats empty cells as if they do not exist:
    • Empty cells are not considered when evaluating the count(*) aggregate.
    • Empty cells are disregarded during join, sort, and unpack operations.
    • Empty cells do not participate in aggregations.
    • Some operators, such as the Linear Algebra operators, interpret empty cells as 0.

The SciDB concept of emptiness is only for entire cells, not for individual attributes.  Even if all of a cell's attributes are NULL (that is, missing), the cell itself is not an empty cell.

Floating-point attributes have additional special values. The following values apply to the SciDB data types double and float.

  • Infinity. During calculations, it is possible to divide by 0 and store the result into an attribute value. SciDB represents this as either inf or -inf, depending on the sign of the dividend.
  • NaN (Not a Number). This behaves the same as the IEEE floating point special value of the same name. It is a floating-point value that does not actually represent a floating-point number. When arithmetic is performed, and one of the arguments is NaN, NaN is always the result. NaN cannot take part in join operations. The following operations can return NaN:
    • Operations with a NaN as at least one operand.
    • Indeterminate forms (such as divisions 0/0 and inf/inf).
    • Real operations with complex results:
      • square root of a negative number
      • logarithm of a negative number
      • inverse sine or cosine of a number that is less than -1 or greater than +1.

Â