Array#

class rbc.heavydb.Array(size, dtype)#

RBC Array<T> type that corresponds to HeavyDB ARRAY

In HeavyDB, an Array of type T is represented as follows:

{
    T* data,
    int64_t size,
    int8_t is_null
}

Array holds a contiguous block of memory and it implements a subset of the array protocol.

Example

from numba import types
from rbc.heavydb import Array

@heavydb('int64[](int64)')
def my_arange(size):
    arr = Array(size, nb_types.int64)
    for i in range(size):
        a[i] = i
    return a

Attributes

Array.T

❌ Not implemented

Array.device

❌ Not implemented

Array.dtype

Data type of the array elements.

Array.mT

❌ Not implemented

Array.ndim

Number of array dimensions (axes).

Array.shape

❌ Not implemented

Array.size

Number of elements in an array.

Methods

Array.__init__(size, dtype)

Array.is_null(index)

Check if array is null.

Array.set_null(index)

Set the array to null.

Array.to_list()

Returns a Python list with elements from the array

Parameters:
  • size (int) –

  • dtype (str | Type) –