schema

package
v0.0.0-...-1ed3a2a Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2020 License: Apache-2.0, Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Element

type Element struct {
	parquet.SchemaElement

	Encoding           *parquet.Encoding         // Optional; defaults is computed.
	CompressionType    *parquet.CompressionCodec // Optional; defaults to SNAPPY.
	Children           *Tree
	MaxDefinitionLevel int64
	MaxRepetitionLevel int64
	PathInTree         string
	PathInSchema       string
	// contains filtered or unexported fields
}

Element - represents schema element and its children. Any element must have Name and RepetitionType fields set.

func NewElement

func NewElement(name string, repetitionType parquet.FieldRepetitionType,
	elementType *parquet.Type, convertedType *parquet.ConvertedType,
	encoding *parquet.Encoding, compressionType *parquet.CompressionCodec,
	children *Tree) (*Element, error)

NewElement - creates new element.

func (*Element) String

func (element *Element) String() string

String - stringify this element.

type Tree

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

Tree - represents tree of schema. Tree preserves order in which elements are added.

func NewTree

func NewTree() *Tree

NewTree - creates new schema tree.

func (*Tree) Delete

func (tree *Tree) Delete(name string)

Delete - deletes name and its element.

func (*Tree) Get

func (tree *Tree) Get(name string) (element *Element, ok bool)

Get - returns the element stored for name.

func (*Tree) Length

func (tree *Tree) Length() int

Length - returns length of tree.

func (*Tree) Range

func (tree *Tree) Range(f func(name string, element *Element) bool)

Range - calls f sequentially for each name and its element. If f returns false, range stops the iteration.

func (*Tree) ReadOnly

func (tree *Tree) ReadOnly() bool

ReadOnly - returns whether this tree is read only or not.

func (*Tree) Set

func (tree *Tree) Set(name string, element *Element) error

Set - adds or sets element to name.

func (*Tree) String

func (tree *Tree) String() string

String - stringify this tree.

func (*Tree) ToParquetSchema

func (tree *Tree) ToParquetSchema() (schemaList []*parquet.SchemaElement, valueElements []*Element, err error)

ToParquetSchema - returns list of parquet SchemaElement and list of elements those stores values.

Jump to

Keyboard shortcuts

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