forked from apache/arrow
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
apacheGH-35775: [Go][Parquet] Allow key value file metadata to be wri…
…tten after writing row groups (apache#37786) ### Rationale for this change The key value file metadata may include information generated while writing row groups. Currently, it is not possible to set the key value file metadata after creating a writer. With the changes in this branch, key value pairs may be added any time before closing the writer. ### What changes are included in this PR? This branch adds a `writer.AppendKeyValueMetadata(key, value)` method to the parquet `file.Writer` and to the `pqarrow.FileWriter`. ### Are these changes tested? Tests are added for the new functionality. ### Are there any user-facing changes? The `KeyValueMetadata` field on the parquet `file.Writer` has been renamed to `initialKeyValueMetadata`. This is a breaking change. Although the field was exported, setting it did not result in new key value metadata being written. Instead, it represented the initial key value metadata if the writer was passed the `WithWriteMetadata` write option. The `WithWriteMetadata` option can still be used to provide the initial key value metadata values. In addition, the `AppendKeyValueMetadata` method can be called to add key value pairs after creating a writer. The `FileMetadata` field on the parquet `file.Writer` has been removed. Previously, setting this field value had no effect. **This PR includes breaking changes to public APIs.** The `KeyValueMetadata` field is no longer exported from the parquet `file.Writer` struct. Use the `WithWriteMetadata` writer option to set key value metadata when creating a writer or use the `AppendKeyValueMetadata` method to add key value metadata after creating a writer. The `FileMetadata` field on the parquet `file.Writer` has been removed. * Closes: apache#35775 Authored-by: Tim Schaub <[email protected]> Signed-off-by: Matt Topol <[email protected]>
- Loading branch information
Showing
6 changed files
with
156 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters