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

GH-40113: [Go][Parquet] New RegisterCodec function #40114

Merged
merged 3 commits into from
Feb 20, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions go/parquet/compress/compress.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,22 @@ type Codec interface {

var codecs = map[Compression]Codec{}

// RegisterCodec add new or override existing codec implementation for a given compression algorithm.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// RegisterCodec add new or override existing codec implementation for a given compression algorithm.
// RegisterCodec adds or overrides a codec implementation for a given compression algorithm.

// The intended use case is within the init() section of a package. For example,
//
// // inside a custom codec package, say czstd
//
// func init() {
// RegisterCodec(compress.Codecs.Zstd, czstdCodec{})
// }
//
// type czstdCodec struct{} // implementing Codec interface using CGO based ZSTD wrapper
//
// And user of the custom codec can import the above package like below,
//
// package main
//
// import _ "package/path/to/czstd"
Copy link
Member

Choose a reason for hiding this comment

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

Can we fix the spacing?

func RegisterCodec(compression Compression, codec Codec) {
codecs[compression] = codec
}
Expand Down
Loading