arrow-left

All pages
gitbookPowered by GitBook
1 of 5

Loading...

Loading...

Loading...

Loading...

Loading...

Column

Cursor

Supported Types and Data Structures

OmniSciDB supports many data typesarrow-up-right but not all of them are supported by the Remote Backend Compiler.

hashtag
Scalar types

Datatype

Size (bytes)

Notes

hashtag
Array

RBC also supports Array<T> where T is one of the following scalar types seen above. Both fixed and variable length arrays are supported in RBC. For more information, see the Array page.

hashtag
Column

hashtag
ColumnList

hashtag
Cursor

BOOLEAN

1

TRUE: 'true', '1', 't'. FALSE: 'false', '0', 'f'. Text values are not case-sensitive.

TINYINT

1

Minimum value: -127; maximum value: 127

SMALLINT

2

Minimum value: -32,767; maximum value: 32,767

INT

4

Minimum value: -2,147,483,647; maximum value: 2,147,483,647.

BIGINT

8

Minimum value: -9,223,372,036,854,775,807; maximum value: 9,223,372,036,854,775,807.

ColumnList

circle-exclamation

ColumnList support requires OmniSciDB 5.6 or newer

Array

In OmniSciDB, an array has the following internal representation:

hashtag
Creating an Array programmatically

*Notice that returning an empty array is an invalid operation that might crash the server.

One can also use one of the array creation functions as specified in the python Array API standardarrow-up-right: full, full_like, zeros, zeros_like, ones and ones_like:

hashtag
Accessing a pointer member

hashtag
Getting the size of an array

hashtag
Checking for null

You can either check if an array is null or if an array value is null

typedef struct {
    T* data;  // contiguous memory block
    int64_t size;
    int8 is_null;  // boolean values in omniscidb are represented as int8 variables
} Array;
from numba import types as nb_types
from rbc.omnisci_backend import Array

@omnisci('double[](int64)')
def create_array(size):
    array = Array(size, nb_types.double)
    for i in range(size):
        array[i] = nb_types.double(i)
    return array
@omnisci('double(double[], int64)')
def get_array_member(array, idx):
    return array[idx]
from numba import types as nb_types
import rbc.omnisci_backend as omni

@omnisci('double[](int64)')
def zero_array(size):
    return omni.zeros(size, nb_types.double)
@omnisci('int64(double[])')
def get_array_size(array):
    return len(array)
@omnisci('int8(double[])')
def is_array_null(array):
    return array.is_null()

@omnisci('int8(double[], int64)')
def is_array_null(array, idx):
    return array.is_null(idx)