Vortex files in pure Go
vortex-go reads and writes the Vortex columnar file format.
A file goes to Go structs, or Go structs go to a file, in a few lines and with no configuration.
There is no cgo: the standard library, plus klauspost/compress for zstd.
Install
go get github.com/fclairamb/vortex-go
Go 1.26 or later.
Read the rows of a file
This block is copied from ExampleRows by go generate, and a test keeps it at 10 lines or fewer.
f, err := vortex.OpenFile("testdata/fixtures/0.96.0/extra/default_ints.vortex")
if err != nil {
log.Fatal(err)
}
defer f.Close()
type Row struct {
Sorted sql.Null[int64] `vortex:"sorted"`
}
for r, err := range vortex.Rows[Row](context.Background(), f, vortex.Query{Rows: vortex.Range{End: 3}}) {
if err != nil {
log.Fatal(err)
}
fmt.Println(r.Sorted.V)
}
More cases, such as columns, filters and writing, are on the usage page.
Status
- Edition. The target is the default
coreedition of the upstream release pinned in.vortex-version: about 50 identifiers of array encodings, layouts, extension types and statistics. Every one of them is read, most are written, see the support matrix. - Releases read. The files of every published upstream release that has fixtures are read, and checked every night against the reference reader.
- Judged by Rust. The Rust reader reads every file we write, and our reader gives the values of the Rust one on every file of the corpus.
- Speed. The numbers, whatever they are, are measured on every merge: against the Rust implementation, and against parquet-go, the Go library for Parquet.
Links
- The API on pkg.go.dev
- The repository
- Vortex, the format and its Rust implementation