Documentation
¶
Overview ¶
Package parquet writes and reads the tables a document holds beside its drawing (docs/spec.md §4.6): Apache Parquet files of flat columns.
Write makes the files the converters store: the columns of a table as optional fields of a flat schema, PLAIN values, RLE definition levels, one row group, no compression (the part the file becomes is compressed as a whole). Read takes those files back, and the files of other writers whose columns are flat and whose pages are PLAIN or dictionary encoded and uncompressed, Snappy or gzip (what pandas, Arrow and DuckDB write by default). Nested columns, the delta encodings and the other codecs are left to converter/parquet, which reads every file.
Index ¶
Constants ¶
const ( // MaxColumns bounds the columns of a table (docs/spec.md §4.6). MaxColumns = 1 << 14 // DefaultMaxRows is the rows Read returns when Limits.MaxRows is 0. DefaultMaxRows = 1 << 20 )
Limits of what is read and written.
Variables ¶
var ( // ErrNotParquet is returned for data that is not a Parquet file. ErrNotParquet = errors.New("parquet: not a Parquet file") )
Functions ¶
func Text ¶
Text writes a value as text: a date as 2006-01-02, a date and time in RFC 3339, a number as Go prints it, a null as "".
func Write ¶
Write writes a table as a Parquet file: its columns as optional fields of a flat schema, their values PLAIN, their definition levels RLE, in one row group, uncompressed. A value that is not of its column's type (see Table) is an error; a row shorter than the columns is padded with nulls, and a column of type Other cannot be written.
Types ¶
type Limits ¶
type Limits struct {
// MaxRows is the most rows returned (DefaultMaxRows when 0; the rows
// after them are left out).
MaxRows int
}
Limits bounds what Read returns.
type Table ¶
Table is a table in memory: its columns, and its rows of values. A value is a string (String), a float64 (Number), an int64 (Integer), a bool (Boolean), a time.Time (Date, at 0:00 UTC; DateTime, UTC) or nil (a null); a value of a column of type Other is what Read made of it (a []byte, a string, a number), or nil.