Skip to main content

Data Types

Spice adheres to Apache Arrow data types. Data accelerators do not support all Arrow data types. The table below outlines the data type compatibility for each accelerator, and datatype used within the accelerator.

Arrow TypeDescriptionDuckDBSQLitePostgres
naA NULL type having no physical storage.
boolBoolean as 1 bit, LSB bit-packed ordering.BOOLEANBOOLBOOL
uint8Unsigned 8-bit little-endian integer.TINYINTTINYINTSMALLINT
int8Signed 8-bit little-endian integer.TINYINTTINYINTSMALLINT
uint16Unsigned 16-bit little-endian integer.SMALLINTSMALLINTSMALLINT
int16Signed 16-bit little-endian integer.SMALLINTSMALLINTSMALLINT
uint32Unsigned 32-bit little-endian integer.INTEGERINTINTEGER
int32Signed 32-bit little-endian integer.INTEGERINTINTEGER
uint64Unsigned 64-bit little-endian integer.BIGINTBIGINTBIGINT
int64Signed 64-bit little-endian integer.BIGINTBIGINTBIGINT
half_float2-byte floating point value
float4-byte floating point valueFLOATFLOATREAL
double8-byte floating point valueDOUBLEDOUBLEDOUBLE PRECISION
stringUTF8 variable-length string as List<Char>VARCHARTEXTTEXT
binaryVariable-length bytes (no guarantee of UTF8-ness)
fixed_size_binaryEach value has equal bytes of binary.
date32int32_t days since the UNIX epochDATEDATE
date64int64_t milliseconds since the UNIX epochDATETIMESTAMP
timestampExact timestamp encoded with int64 since UNIX epoch, seconds or millisecondsTIMESTAMP_S, TIMESTAMP_MSTIMESTAMPTIMESTAMP
time32Time as signed 32-bit integer, seconds or milliseconds since midnight.TIMETIME
time64Time as signed 64-bit integer, microseconds or nanoseconds since midnight.TIMETIME
interval_monthsYEAR_MONTH interval in SQL style.
interval_day_timeDAY_TIME interval in SQL style.
decimal128Precision- and scale-based decimal type with 128 bits.DOUBLEDECIMAL(38, 10)DECIMAL(38, 10)
decimalDefined for backward-compatibility.
decimal256Precision- and scale-based decimal type with 256 bits.
listA list of some logical data type.TYPE[]
structStruct of logical types.
sparse_unionSparse unions of logical types.
dense_unionDense unions of logical types.
dictionaryDictionary-encoded type,
mapMap, a repeated struct logical type.
extensionCustom data type, implemented by user.
fixed_size_listFixed size list of some logical type.
durationElapsed time in seconds, milliseconds, microseconds or nanoseconds.
large_stringLike STRING, but with 64-bit offsets.
large_binaryLike BINARY, but with 64-bit offsets.
large_listLike LIST, but with 64-bit offsets.
interval_month_day_nanoCalendar interval type with three fields.
run_end_encodedRun-end encoded data.
string_viewUTF8 view type with 4-byte prefix & inline small string optimization.
binary_viewBytes view type with 4-byte prefix and inline small string optimization.
list_viewA list of some logical data type represented by offset and size.
large_list_viewLike LIST_VIEW, but with 64-bit offsets and sizes.

Note: Where TYPE is used (e.g. TYPE[]), it refers an established supported type for the specific data accelerator (e.g. INTEGER[]).