Skip to content

Expose Parquet encoding/type compatibility validation API #10964

Description

@kevinjqliu

Problem

WriterPropertiesBuilder::set_column_encoding accepts any Encoding for any column, but incompatible encoding/physical-type combinations can panic when the encoder is constructed. For example, configuring RLE for an INT64 column reaches RleValueEncoder::new, whose ensure_phys_ty! check panics. Likewise, DELTA_BINARY_PACKED on a BYTE_ARRAY column panics in DeltaBitPackEncoder::new.

Downstream callers that accept user-selected encodings need to duplicate parquet's compatibility matrix to validate input and return a normal error before writing. That matrix can drift as parquet adds encodings or changes support.

Requested API/behavior

Please expose a stable, fallible API that validates whether an Encoding is supported for a physical type or column descriptor, or make writer/encoder construction return ParquetError rather than panic for incompatible combinations. Downstream callers could then delegate validation to parquet instead of maintaining a copy.

This arose while implementing per-column encoding selection in datafusion-contrib/tpcgen-rs#405.

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