Skip to content

Commit

Permalink
[apache#35775] Add pqarrow.AppendKeyValueMetadata()
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-montoux committed May 26, 2023
1 parent 8ef8820 commit 8596671
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions go/parquet/pqarrow/file_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,15 @@ func (fw *FileWriter) WriteTable(tbl arrow.Table, chunkSize int64) error {
return nil
}

// AppendKeyValueMetadata appends key and value to the underlying parquet metadata. If either key
// or value contains an invalid utf8 rune, nothing is added and an error is returned.
func (fw *FileWriter) AppendKeyValueMetadata(key, value string) error {
if fw.wr.KeyValueMetadata == nil {
fw.wr.KeyValueMetadata = metadata.NewKeyValueMetadata()
}
return fw.wr.KeyValueMetadata.Append(key, value)
}

// Close flushes out the data and closes the file. It can be called multiple times,
// subsequent calls after the first will have no effect.
func (fw *FileWriter) Close() error {
Expand Down

0 comments on commit 8596671

Please sign in to comment.