vortex-go

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

Links