remove

The remove operator removes an array and its attendant schema definition from the SciDB database.

Synopsis

remove(named_array);


Summary

The AFL remove statement works like the AQL DROP ARRAY statement. It deletes a named array, including all of its versions and its schema definition, from the SciDB database. The argument named_array must be an array that was previously created and stored in SciDB.

Note that remove is an AFL statement, but not an operator. Consequently, it does not produce a result array, it cannot appear in the FROM clause of an AQL SELECT statement, and it cannot appear as an operand within AFL operators.

The remove() statement removes all versions of a single array; there are other options:

  • To remove older versions of an array but retain more recent versions, use remove_versions(), described in remove_versions.
  • You can remove multiple arrays with a single shell command with the arrays.py Python script.  Run arrays.py --help at a shell  prompt for details.

Inputs

named_array:  An existing array within the SciDb system.

Example

To create an array named source and then remove it, do the following:

  1.  Create the array named source.

    AFL% store(build(<val:double>[i=0:9],1),source);

    The output is:

    {i} val
    {0} 1
    {1} 1
    {2} 1
    {3} 1
    {4} 1
    {5} 1
    {6} 1
    {7} 1
    {8} 1
    {9} 1

     

  2. Remove the array named source.

    AFL% remove(source); 


    The output is:

    Query was executed successfully.  

Within Transactions

The target array will not be removed until the transaction is committed.  If an array is removed within a transaction and that transaction aborts then the array will not be removed.  Any changes made to the array after it has been removed in a transaction but before the transaction has committed will not persist.