Skip to content

Avro reader treats a missing avro.codec as gzip and raises 'Unsupported codec: gzip' #4295

Closed

Description

@jatorre

Apache Iceberg version

0.12.0 (and main)

Please describe the bug 🐞

AvroFileHeader.compression_codec() reads a missing avro.codec entry as TableProperties.WRITE_AVRO_COMPRESSION_DEFAULT ("gzip"). That is an Iceberg property value, not an Avro codec name, so it is not in KNOWN_CODECS and the read raises ValueError: Unsupported codec: gzip. The Avro specification makes null (uncompressed) the default for a file without the entry.

iceberg-rust writes manifests without the entry (apache/iceberg-rust#3639 is about using its commits from Python), so a table with one snapshot from iceberg-rust cannot be scanned from PyIceberg:

File "pyiceberg/avro/file.py", line 94, in compression_codec
    raise ValueError(f"Unsupported codec: {codec_name}")
ValueError: Unsupported codec: gzip

Willingness to contribute

  • I can contribute a fix for this bug independently

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