Skip to content

Parquet file format proto decode panics on invalid writer_version #22468

@fallintoplace

Description

@fallintoplace

Describe the bug

The Parquet file format proto decoder can panic while decoding malformed TableParquetOptions bytes.

ParquetLogicalExtensionCodec::try_decode_file_format returns a Result, but it converts decoded TableParquetOptionsProto through an infallible FromProto path. That path parses ParquetOptionsProto.writer_version with expect, so an invalid value such as "3.0" aborts the decode path instead of returning a DataFusion error.

To Reproduce

Construct a TableParquetOptionsProto with a present global options message and an invalid writer version:

TableParquetOptionsProto {
    global: Some(ParquetOptionsProto {
        writer_version: "3.0".to_string(),
        ..Default::default()
    }),
    ..Default::default()
}

Encode it and pass the bytes to ParquetLogicalExtensionCodec::try_decode_file_format.

Expected behavior

The decoder should return an error, consistent with the try_decode_file_format API and the existing writer-version validation.

Additional context

An empty proto writer_version should continue to use DataFusion's default writer version so proto default values remain compatible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions