Skip to main content
The 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

Example:

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.
Example:

Timestamp Nano

Timestamp with nanosecond precision.

String

Variable-length UTF-8 string.

UUID

Universally unique identifier (128-bit).

Fixed

Fixed-length byte array.
Example:

Binary

Variable-length byte array.

Decimal

Fixed-point decimal with precision and scale.
Parameters:
  • precision - Total number of digits (max 38)
  • scale - Number of digits after decimal point
Example:

Spatial Types

Geometry

Geometry type with optional coordinate reference system.
Example:

Geography

Geography type with CRS and edge algorithm.
Example:

Complex Types

Struct

Structured type with named fields.
Example:

List

Ordered collection of elements.
Example:

Map

Key-value pairs.
Example:

Nested Fields

Fields in struct types.

Creating Fields

Example:

Field Builder

Field Properties

Type Utilities

Parsing Type Strings

Example:

Type Checking

Type Conversion

Examples

Creating a Schema with Types

Nested Struct Type

Complex Nested Types

Working with Field Defaults

See Also