Types class provides the type system for Apache Iceberg, defining primitive and complex data types supported in Iceberg schemas.
Overview
Iceberg’s type system includes:- Primitive types (boolean, int, long, float, double, date, time, timestamp, string, uuid, fixed, binary, decimal)
- Complex types (struct, list, map)
- Special types (variant, geometry, geography)
Primitive Types
Boolean
Integer (32-bit)
Long (64-bit)
Float (32-bit)
Double (64-bit)
Date
Date without time, stored as days from 1970-01-01.Time
Time of day without date, stored as microseconds from midnight.Timestamp
Timestamp with microsecond precision.Timestamp Nano
Timestamp with nanosecond precision.String
Variable-length UTF-8 string.UUID
Universally unique identifier (128-bit).Fixed
Fixed-length byte array.Binary
Variable-length byte array.Decimal
Fixed-point decimal with precision and scale.precision- Total number of digits (max 38)scale- Number of digits after decimal point
Spatial Types
Geometry
Geometry type with optional coordinate reference system.Geography
Geography type with CRS and edge algorithm.Complex Types
Struct
Structured type with named fields.List
Ordered collection of elements.Map
Key-value pairs.Nested Fields
Fields in struct types.Creating Fields
Field Builder
Field Properties
Type Utilities
Parsing Type Strings
Type Checking
Type Conversion
Examples
Creating a Schema with Types
Nested Struct Type
Complex Nested Types
Working with Field Defaults
See Also
- Schema - Table schema definition
- Expressions - Expression and literal types
- Transforms - Partition transforms