create_array
The create_array operator creates a new array or data frame.
Synopsis
create_array( name, schema, isTempArray
[, distribution [, emptyTagCompression ]] )
new_array_name ::= identifier
schema ::= < attributes > [ \[ dimensions \] ]
isTempArray ::=
true
|
false
emptyTagCompression ::=
'zlib'
|
'bzlib'
Summary
The create_array operator creates a new array with the name and other properties specified. The array will have no cells in it after creation.
Inputs
The create_array operator takes the following parameters:
- name: Each array in a SciDB database has an identifier that distinguishes it from all other arrays in the same database.
- schema: The attributes and dimensions of the array.
- attributes: The names and types of the data stored in the cells of the array. See Array Attributes.
- dimensions: See Array Dimensions
- isTempArray: an option that can give more performance when the array does not need to persist. See SciDB Database Arrays
- distribution: how the chunks of a SciDB array should be assigned to storage instances. For details see Array Distribution.
- emptyTagCompression: which compression algorithm to use for the empty tag attribute. Valid values are 'zlib' and 'bzlib'. The default is no compression. Most users should stay with the default value.
Example
To demonstrate the create_array operator, do the following:
Create an array by entering:
AFL% create_array(A, <val:string>[row=0:2; col=0:2], false);
Scan the resulting (empty) array:
AFL% scan(A); {row,col} val
To specify a distribution:
AFL% create_array(B, <val:string>[row=0:2; col=0:2], false, replicated); AFL% scan(B); {row,col} val