Data TypesΒΆ

Apache Ignite uses a sophisticated system of serializable data types to store and retrieve user data, as well as to manage the configuration of its caches through the Ignite binary protocol.

The complexity of data types varies from simple integer or character types to arrays, maps, collections and structures.

Each data type is defined by its code. Type code is byte-sized. Thus, every data object can be represented as a payload of fixed or variable size, logically divided into one or more fields, prepended by the type_code field.

Most of Ignite data types can be represented by some of the standard Python data type or class. Some of them, however, are conceptually alien, overly complex, or ambiguous to Python dynamic type system.

The following table summarizes the notion of Apache Ignite data types, as well as their representation and handling in Python. For the nice description, as well as gory implementation details, you may follow the link to the parser/constructor class definition. Note that parser/constructor classes are not instantiatable. The class here is used mostly as a sort of tupperware for organizing methods together.

Note: you are not obliged to actually use those parser/constructor classes. Pythonic types will suffice to interact with Apache Ignite binary API. However, in some rare cases of type ambiguity, as well as for the needs of interoperability, you may have to sneak one or the other class, along with your data, in to some API function as a type conversion hint.

type_code

Apache Ignite docs reference

Python type or class

Parser/constructor class

Primitive data types

0x01

Byte

int

ByteObject

0x02

Short

int

ShortObject

0x03

Int

int

IntObject

0x04

Long

int

LongObject

0x05

Float

float

FloatObject

0x06

Double

float

DoubleObject

0x07

Char

str

CharObject

0x08

Bool

bool

BoolObject

0x65

Null

NoneType

Null

Standard objects

0x09

String

Str

String

0x0a

UUID

uuid.UUID

UUIDObject

0x21

Timestamp

tuple

TimestampObject

0x0b

Date

datetime.datetime

DateObject

0x24

Time

datetime.timedelta

TimeObject

0x1e

Decimal

decimal.Decimal

DecimalObject

0x1c

Enum

tuple

EnumObject

0x67

Binary enum

tuple

BinaryEnumObject

Arrays of primitives

0x0c

Byte array

iterable/bytearray

ByteArrayObject

0x0d

Short array

iterable/list

ShortArrayObject

0x0e

Int array

iterable/list

IntArrayObject

0x0f

Long array

iterable/list

LongArrayObject

0x10

Float array

iterable/list

FloatArrayObject

0x11

Double array

iterable/list

DoubleArrayObject

0x12

Char array

iterable/list

CharArrayObject

0x13

Bool array

iterable/list

BoolArrayObject

Arrays of standard objects

0x14

String array

iterable/list

StringArrayObject

0x15

UUID array

iterable/list

UUIDArrayObject

0x22

Timestamp array

iterable/list

TimestampArrayObject

0x16

Date array

iterable/list

DateArrayObject

0x23

Time array

iterable/list

TimeArrayObject

0x1f

Decimal array

iterable/list

DecimalArrayObject

Object collections, special types, and complex object

0x17

Object array

tuple[int, iterable/list]

ObjectArrayObject

0x18

Collection

tuple[int, iterable/list]

CollectionObject

0x19

Map

tuple[int, dict/OrderedDict]

MapObject

0x1d

Enum array

iterable/list

EnumArrayObject

0x67

Complex object

object

BinaryObject

0x1b

Wrapped data

tuple[int, bytes]

WrappedDataObject