segmentio / parquet-go

Go library to read/write Parquet files
https://pkg.go.dev/github.com/segmentio/parquet-go
Apache License 2.0
341 stars 104 forks source link

Add the ability to pass Parquet tags on map key and values #268

Closed Pryz closed 2 years ago

Pryz commented 2 years ago

Fixes #256

achille-roussel commented 2 years ago

We discussed offline the option to use a different struct tag name for the key, e.g. key, mapkey or parquet-key, which has advantages over the key= prefix:

Did you get a chance to give this more thoughts?

Pryz commented 2 years ago

Did some experimentation and went with the parquet-key tag.

Example:

type Spans struct {
    Attributes map[string]json.RawMessage `parquet:"attributes,optional,json,zstd" parquet-key:"zstd"`
}
Pryz commented 2 years ago

Thanks for the review !