Skip to content

Is it possible for ArrowWriter to write key_value_metadata after write all records #3356

Description

@jiacai2050

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

The metadata of parquet is placed in the footer, In this design, metadata can be written after the data has been written, which allow for single pass writing.

But in current implementation of ArrowWriter, we can only provide WriterProperties in try_new, for most fields of WriterProperties this is fine, but not the case for key_value_metadata.

key_value_metadata is meant for users to save customized information, for example we can encode some stats in here.

This usually means that we need to loop the original data to get stats information, this means we have to loop data twice:

  1. First to get the stats information
  2. Second to write to parquet

If ArrowWriter could provide a way to set key_value_metadata after write all records, then only one loop is need.

Describe the solution you'd like

Add new method in ArrowWriter/SerializedFileWriter to let users set key_value_metadata.

Describe alternatives you've considered

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementAny new improvement worthy of a entry in the changeloggood first issueGood for newcomershelp wantedparquetChanges to the parquet crate

    Type

    No type

    Fields

    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