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
Type Storage Use Case TINYINT1 byte Status codes, enum values SMALLINT2 bytes Year values, small-range counters INT4 bytes General integer IDs, counters BIGINT8 bytes Large-scale IDs, millisecond timestamps FLOAT4 bytes Low-precision floating point, scientific computing DOUBLE8 bytes High-precision floating point, statistical analysis DECIMAL(p,s)Variable Monetary amounts, exact calculations (recommended)
String Types
Type Length Use Case CHAR(n)Fixed, max 255 Fixed-length codes (country codes, status codes) VARCHAR(n)Variable, max 1,048,576 Fields with a length cap (usernames, email addresses) STRINGUnlimited Long text, JSON strings (recommended)
⚠️ Note : All three string types silently truncate when the declared length is exceeded — no error is raised.
Time Types
Type Timezone Use Case DATENone Date 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 INTERVAL— Time differences, date arithmetic
Other Basic Types
Type Description BOOLEANTRUE / FALSE / NULLBINARYBinary byte sequence
Complex Types
Type Description Use Case ARRAY<T>Ordered collection of same-type elements Tag lists, multi-value attributes MAP<K,V>Key-value pair collection Dynamic attributes, configuration items STRUCT<...>Nested structure with fixed fields Addresses, coordinates, and other structured nesting JSONSemi-structured JSON document Flexible schema, event attributes VECTOR(n)Fixed-dimension floating-point vector Embedding storage, vector search, RAG BITMAPCompressed integer set (Roaring Bitmap) UV statistics, user tag segmentation
In This Chapter
Page Description Data Types Reference Full description of each type, type alias mapping, migration compatibility Data Type Conversion Explicit conversion (CAST / ::) and implicit conversion rules Numeric Types TINYINT / SMALLINT / INT / BIGINT / FLOAT / DOUBLE / DECIMAL in detail String Types CHAR / VARCHAR / STRING comparison and selection guide Date/Time Types DATE / TIMESTAMP / TIMESTAMP_NTZ / INTERVAL comparison and selection guide BINARY Binary type reference BOOLEAN Boolean type reference ARRAY Array type syntax and functions MAP Map type syntax and functions STRUCT Nested struct type syntax and functions JSON JSON type syntax, field access, and query examples VECTOR Vector type syntax, dimension configuration, and vector index usage BITMAP Bitmap type syntax, set operation functions reference