person

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 6, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolType

func BoolType(se *sch.SchemaElement)

func Float32Type

func Float32Type(se *sch.SchemaElement)

func Float64Type

func Float64Type(se *sch.SchemaElement)

func Gzip

func Gzip(p *ParquetWriter) error

func Int32Type

func Int32Type(se *sch.SchemaElement)

func Int64Type

func Int64Type(se *sch.SchemaElement)

func MaxPageSize

func MaxPageSize(m int) func(*ParquetWriter) error

MaxPageSize is the maximum number of rows in each row groups' page.

func Snappy

func Snappy(p *ParquetWriter) error

func StringType

func StringType(se *sch.SchemaElement)

func Uint32Type

func Uint32Type(se *sch.SchemaElement)

func Uint64Type

func Uint64Type(se *sch.SchemaElement)

func Uncompressed

func Uncompressed(p *ParquetWriter) error

Types

type Field

type Field interface {
	Add(r Person)
	Write(w io.Writer, meta *parquet.Metadata) error
	Schema() parquet.Field
	Scan(r *Person)
	Read(r io.ReadSeeker, pg parquet.Page) error
	Name() string
	Levels() ([]uint8, []uint8)
}

func Fields

func Fields(compression compression) []Field

type Hobby

type Hobby struct {
	Name       string  `parquet:"name"`
	Difficulty *int32  `parquet:"difficulty"`
	Skills     []Skill `parquet:"skills"`
}

type Int32OptionalField

type Int32OptionalField struct {
	parquet.OptionalField
	// contains filtered or unexported fields
}

func NewInt32OptionalField

func NewInt32OptionalField(read func(r Person, vals []int32, defs, reps []uint8) ([]int32, []uint8, []uint8), write func(r *Person, vals []int32, defs, reps []uint8) (int, int), path []string, types []int, opts ...func(*parquet.OptionalField)) *Int32OptionalField

func (*Int32OptionalField) Add

func (f *Int32OptionalField) Add(r Person)

func (*Int32OptionalField) Levels

func (f *Int32OptionalField) Levels() ([]uint8, []uint8)

func (*Int32OptionalField) Read

func (*Int32OptionalField) Scan

func (f *Int32OptionalField) Scan(r *Person)

func (*Int32OptionalField) Schema

func (f *Int32OptionalField) Schema() parquet.Field

func (*Int32OptionalField) Write

func (f *Int32OptionalField) Write(w io.Writer, meta *parquet.Metadata) error

type Levels

type Levels struct {
	Name string
	Defs []uint8
	Reps []uint8
}

type ParquetReader

type ParquetReader struct {
	// contains filtered or unexported fields
}

ParquetReader reads one page from a row group.

func NewParquetReader

func NewParquetReader(r io.ReadSeeker, opts ...func(*ParquetReader)) (*ParquetReader, error)

func (*ParquetReader) Error

func (p *ParquetReader) Error() error

func (*ParquetReader) Levels

func (p *ParquetReader) Levels() []Levels

func (*ParquetReader) Next

func (p *ParquetReader) Next() bool

func (*ParquetReader) Rows

func (p *ParquetReader) Rows() int64

func (*ParquetReader) Scan

func (p *ParquetReader) Scan(x *Person)

type ParquetWriter

type ParquetWriter struct {
	// contains filtered or unexported fields
}

ParquetWriter reprents a row group

func NewParquetWriter

func NewParquetWriter(w io.Writer, opts ...func(*ParquetWriter) error) (*ParquetWriter, error)

func (*ParquetWriter) Add

func (p *ParquetWriter) Add(rec Person)

func (*ParquetWriter) Close

func (p *ParquetWriter) Close() error

func (*ParquetWriter) Write

func (p *ParquetWriter) Write() error

type Person

type Person struct {
	Name  string `parquet:"name"`
	Hobby *Hobby `parquet:"hobby"`
}

type Skill

type Skill struct {
	Name       string `parquet:"name"`
	Difficulty string `parquet:"difficulty"`
}

type StringField

type StringField struct {
	parquet.RequiredField
	// contains filtered or unexported fields
}

func NewStringField

func NewStringField(read func(r Person) string, write func(r *Person, vals []string), path []string, opts ...func(*parquet.RequiredField)) *StringField

func (*StringField) Add

func (f *StringField) Add(r Person)

func (*StringField) Levels

func (f *StringField) Levels() ([]uint8, []uint8)

func (*StringField) Read

func (f *StringField) Read(r io.ReadSeeker, pg parquet.Page) error

func (*StringField) Scan

func (f *StringField) Scan(r *Person)

func (*StringField) Schema

func (f *StringField) Schema() parquet.Field

func (*StringField) Write

func (f *StringField) Write(w io.Writer, meta *parquet.Metadata) error

type StringOptionalField

type StringOptionalField struct {
	parquet.OptionalField
	// contains filtered or unexported fields
}

func NewStringOptionalField

func NewStringOptionalField(read func(r Person, vals []string, def, rep []uint8) ([]string, []uint8, []uint8), write func(r *Person, vals []string, defs, reps []uint8) (int, int), path []string, types []int, opts ...func(*parquet.OptionalField)) *StringOptionalField

func (*StringOptionalField) Add

func (f *StringOptionalField) Add(r Person)

func (*StringOptionalField) Levels

func (f *StringOptionalField) Levels() ([]uint8, []uint8)

func (*StringOptionalField) Read

func (*StringOptionalField) Scan

func (f *StringOptionalField) Scan(r *Person)

func (*StringOptionalField) Schema

func (f *StringOptionalField) Schema() parquet.Field

func (*StringOptionalField) Write

func (f *StringOptionalField) Write(w io.Writer, meta *parquet.Metadata) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL