Skip to main content

relation_desc_to_iceberg_schema

Function relation_desc_to_iceberg_schema 

Source
fn relation_desc_to_iceberg_schema(
    desc: &RelationDesc,
) -> Result<(Schema, SchemaRef)>
Expand description

Convert a Materialize RelationDesc into Arrow and Iceberg schemas.

Returns a tuple of:

  • The Arrow schema (with field IDs and Iceberg-compatible types) for writing Parquet files
  • The Iceberg schema for table creation/validation

Iceberg doesn’t support unsigned integer types, so we use iceberg_type_overrides to map them to compatible types (e.g., UInt64 -> Decimal128(20,0)). The ArrowBuilder handles the cross-type conversion (Datum::UInt64 -> Decimal128Builder) automatically.