Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow updating key-value metadata after ParquetFileWriter creation #279

Merged
merged 4 commits into from
Jun 13, 2022

Conversation

adamreeve
Copy link
Contributor

@adamreeve adamreeve commented Jun 1, 2022

This PR changes ParquetFileWriter so that it doesn't read the KeyValueMetadata dictionary until the file is closed, to allow metadata entries to be added or updated at any time before the file is closed.

Internally, the Arrow C++ ParquetFileWriter takes a std::shared_ptr<const KeyValueMetadata> and then doesn't read the entries from the metadata until the file is closed and the footer is written, so this behaviour closely maps to the C++ API.

This changes behaviour and has the potential to be a breaking change if anyone is relying on being able to modify the metadata dictionary after passing it to the ParquetFileWriter constructor without this affecting the written metadata. That seems fairly unlikely though.

@adamreeve adamreeve added the enhancement New feature or request label Jun 13, 2022
@adamreeve adamreeve marked this pull request as ready for review June 13, 2022 03:48
Copy link
Contributor

@marcin-krystianc marcin-krystianc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I think you've covered all possible cases in the newly added tests - well done 👍

@adamreeve adamreeve merged commit db37fbc into G-Research:master Jun 13, 2022
@adamreeve adamreeve deleted the key-value-metadata-update branch June 13, 2022 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants