Data Types

Singdata Lakehouse supports numeric, string, time, boolean, binary, and complex types (ARRAY, MAP, STRUCT, JSON, VECTOR, BITMAP). It is compatible with common type aliases from MySQL, PostgreSQL, Hive, and other systems, so migrated DDL scripts can run without manually replacing type names.


Type Quick Reference

Numeric Types

TypeStorageUse Case
TINYINT1 byteStatus codes, enum values
SMALLINT2 bytesYear values, small-range counters
INT4 bytesGeneral integer IDs, counters
BIGINT8 bytesLarge-scale IDs, millisecond timestamps
FLOAT4 bytesLow-precision floating point, scientific computing
DOUBLE8 bytesHigh-precision floating point, statistical analysis
DECIMAL(p,s)VariableMonetary amounts, exact calculations (recommended)

String Types

TypeLengthUse Case
CHAR(n)Fixed, max 255Fixed-length codes (country codes, status codes)
VARCHAR(n)Variable, max 1,048,576Fields with a length cap (usernames, email addresses)
STRINGUnlimitedLong text, JSON strings (recommended)

Time Types

TypeTimezoneUse Case
DATENoneDate dimensions, birthdays
TIMESTAMPWith timezone (stored as UTC)Cross-timezone event times, log timestamps
TIMESTAMP_NTZNo timezone (stored as-is)Local business time, no timezone conversion needed
INTERVALTime differences, date arithmetic

Other Basic Types

TypeDescription
BOOLEANTRUE / FALSE / NULL
BINARYBinary byte sequence

Complex Types

TypeDescriptionUse Case
ARRAY<T>Ordered collection of same-type elementsTag lists, multi-value attributes
MAP<K,V>Key-value pair collectionDynamic attributes, configuration items
STRUCT<...>Nested structure with fixed fieldsAddresses, coordinates, and other structured nesting
JSONSemi-structured JSON documentFlexible schema, event attributes
VECTOR(n)Fixed-dimension floating-point vectorEmbedding storage, vector search, RAG
BITMAPCompressed integer set (Roaring Bitmap)UV statistics, user tag segmentation

In This Chapter

PageDescription
Data Types ReferenceFull description of each type, type alias mapping, migration compatibility
Data Type ConversionExplicit conversion (CAST / ::) and implicit conversion rules
Numeric TypesTINYINT / SMALLINT / INT / BIGINT / FLOAT / DOUBLE / DECIMAL in detail
String TypesCHAR / VARCHAR / STRING comparison and selection guide
Date/Time TypesDATE / TIMESTAMP / TIMESTAMP_NTZ / INTERVAL comparison and selection guide
BINARYBinary type reference
BOOLEANBoolean type reference
ARRAYArray type syntax and functions
MAPMap type syntax and functions
STRUCTNested struct type syntax and functions
JSONJSON type syntax, field access, and query examples
VECTORVector type syntax, dimension configuration, and vector index usage
BITMAPBitmap type syntax, set operation functions reference

DocumentDescription
Data Type Conversion GuideType mapping when migrating from MySQL / PostgreSQL / Hive
TIMESTAMP_NTZ ReferenceDetailed explanation and use cases for timezone-free timestamps
CREATE TABLEFull syntax for using data types when creating tables