Skip to content

Kafka Connect: UUID columns fail to write with Parquet (ClassCastException) #17076

Open

Description

@thswlsqls

Apache Iceberg version
main @ 49b89a8

Query engine
Kafka Connect (N/A — not Spark/Flink)

Please describe the bug
RecordConverter.convertUUID() (kafka-connect/kafka-connect/src/main/java/org/apache/iceberg/connect/data/RecordConverter.java line 508) converts UUID values to byte[] when the target file format is Parquet. The Parquet UUID writer, ParquetValueWriters.uuids() (via BaseParquetWriter's default visitor), expects a java.util.UUID and converts to bytes internally, so a byte[] fails to cast during write. ORC (GenericOrcWriters.uuids()) and Avro both write UUID directly — only the Parquet branch in convertUUID diverges from this.

Steps to reproduce
Sink a record with a UUID field to an Iceberg table using the default file format (Parquet). IcebergWriter.convertToRow() calls convertUUID(), which returns byte[]; the Parquet writer stack then throws on write.
Expected: the record writes successfully.
Actual: ClassCastException: class [B cannot be cast to class java.util.UUID.

Additional context
The byte[] conversion matched the Parquet writer contract before PR #11904 ("Parquet: Add readers and writers for the internal object model", merged 2025-01-24) changed ParquetValueWriters' UUID writer to accept UUID directly. kafka-connect was never updated to follow, making this a regression from that writer-contract change.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions