schema

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	GoType reflect.Type
	Info   *common.Tag
}

func NewItem

func NewItem() *Item

type JSONSchemaItemType

type JSONSchemaItemType struct {
	Tag    string
	Fields []*JSONSchemaItemType
}

func NewJSONSchemaItem

func NewJSONSchemaItem() *JSONSchemaItemType

type PathMapType

type PathMapType struct {
	Path     string
	Children map[string]*PathMapType
}

PathMapType records the path and its children; This is used in Marshal for improve performance.

func NewPathMap

func NewPathMap(path string) *PathMapType

func (*PathMapType) Add

func (self *PathMapType) Add(path []string)

type SchemaHandler

type SchemaHandler struct {
	SchemaElements []*parquet.SchemaElement
	MapIndex       map[string]int32
	IndexMap       map[int32]string
	PathMap        *PathMapType
	Infos          []*common.Tag

	InPathToExPath map[string]string
	ExPathToInPath map[string]string

	ValueColumns []string
}

SchemaHandler stores the schema data

func NewSchemaHandlerFromJSON

func NewSchemaHandlerFromJSON(str string) (sh *SchemaHandler, err error)

func NewSchemaHandlerFromMetadata

func NewSchemaHandlerFromMetadata(mds []string) *SchemaHandler

Create a schema handler from CSV metadata

func NewSchemaHandlerFromSchemaList

func NewSchemaHandlerFromSchemaList(schemas []*parquet.SchemaElement) *SchemaHandler

NewSchemaHandlerFromSchemaList creates schema handler from schema list

func NewSchemaHandlerFromStruct

func NewSchemaHandlerFromStruct(obj interface{}) (sh *SchemaHandler, err error)

Create schema handler from a object

func (*SchemaHandler) ConvertToInPathStr added in v1.4.0

func (self *SchemaHandler) ConvertToInPathStr(pathStr string) (string, error)

Convert a path to internal path

func (*SchemaHandler) CreateInExMap

func (self *SchemaHandler) CreateInExMap()

func (*SchemaHandler) GetColumnNum

func (self *SchemaHandler) GetColumnNum() int64

func (*SchemaHandler) GetExName added in v1.4.0

func (self *SchemaHandler) GetExName(index int) string

func (*SchemaHandler) GetInName added in v1.4.0

func (self *SchemaHandler) GetInName(index int) string

func (*SchemaHandler) GetRepetitionLevelIndex added in v1.4.0

func (self *SchemaHandler) GetRepetitionLevelIndex(path []string, rl int32) (int32, error)

MaxRepetitionLevel returns the max repetition level type of a column by it's schema path

func (*SchemaHandler) GetRepetitionType

func (self *SchemaHandler) GetRepetitionType(path []string) (parquet.FieldRepetitionType, error)

GetRepetitionType returns the repetition type of a column by it's schema path

func (*SchemaHandler) GetRootExName added in v1.4.0

func (self *SchemaHandler) GetRootExName() string

func (*SchemaHandler) GetRootInName added in v1.4.0

func (self *SchemaHandler) GetRootInName() string

Get root name from the schema handler

func (*SchemaHandler) GetType added in v1.4.0

func (self *SchemaHandler) GetType(prefixPath string) (reflect.Type, error)

func (*SchemaHandler) GetTypes added in v1.4.0

func (self *SchemaHandler) GetTypes() []reflect.Type

Get object type from schema by reflect

func (*SchemaHandler) MaxDefinitionLevel

func (self *SchemaHandler) MaxDefinitionLevel(path []string) (int32, error)

MaxDefinitionLevel returns the max definition level type of a column by it's schema path

func (*SchemaHandler) MaxRepetitionLevel

func (self *SchemaHandler) MaxRepetitionLevel(path []string) (int32, error)

MaxRepetitionLevel returns the max repetition level type of a column by it's schema path

Jump to

Keyboard shortcuts

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