Skip to content

arrow_schema_to_schema fails to convert Arrow fields with UUID extension to Iceberg UUID #2929

Closed

Description

@JosephLenton

Apache Iceberg Rust version

None

Describe the bug

Arrow supports a UUID extension type. When calling arrow_schema_to_schema, this extension is ignored. This adds friction when using UUID fields with Iceberg.

I propose that arrow_schema_to_schema takes the UUID extension into account, and when present, converts items to the Iceberg UUID type.

This adds friction because in practice we often need both Arrow and Iceberg schemas for fields. Which means either defining the fields twice by hand, or adding a wrapper around arrow_schema_to_schema to fixup the conversion (this is what I have had to do in my own work).

To Reproduce

Here is a test for crates/iceberg/src/arrow/schema.rs which recreates the behaviour I would expect:

use arrow_schema::extension::Uuid as DataTypeUuidExt;

#[test]
fn test_arrow_schema_to_schema_should_convert_uuids() {
    let converted_schema = arrow_schema_to_schema(&ArrowSchema::new(vec![
        simple_field("uuid_field", DataType::FixedSizeBinary(16), false, "1")
            .with_extension_type(DataTypeUuidExt),
    ]))
    .unwrap();

    let expected = Schema::builder()
        .with_fields([NestedField::required(
            1,
            "uuid_field",
            Type::Primitive(PrimitiveType::Uuid),
        )
        .into()])
        .build()
        .unwrap();

    pretty_assertions::assert_eq!(expected, converted_schema);
}

Expected behavior

Willingness to contribute

I can contribute a fix for this bug independently

Activity

  1. added
    bug
    on Jul 30, 2026
  2. JosephLenton commented on Jul 30, 2026

    @JosephLenton
    ContributorAuthor

    I can code up a PR for this if there is interest.

    One question I have however is I believe the Iceberg UUID type is added in the V3 spec, and arrow_schema_to_schema has no awareness of the spec in use. If someone were using V2 tables, then they wouldn't want the conversion to Iceberg UUID, and would instead want it kept as FixedSizeBinary(16).

    Is this a concern, or something we care about?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions