marshal

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2021 License: Apache-2.0 Imports: 10 Imported by: 30

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(srcInterface []interface{}, schemaHandler *schema.SchemaHandler) (tb *map[string]*layout.Table, err error)

Convert the objects to table map. srcInterface is a slice of objects

func MarshalArrow added in v1.6.2

func MarshalArrow(recs []interface{}, schemaHandler *schema.SchemaHandler) (
	tb *map[string]*layout.Table, err error)

MarshalArrow accepts a slice of rows with which it creates a table object. We need to append row by row as opposed to the arrow go provided way of column by column since the wrapper ParquetWriter uses the number of rows to execute intermediate flush depending on the size of the objects, determined by row, which are currently written.

func MarshalCSV

func MarshalCSV(records []interface{}, schemaHandler *schema.SchemaHandler) (*map[string]*layout.Table, error)

Marshal function for CSV like data

func MarshalJSON

func MarshalJSON(ss []interface{}, schemaHandler *schema.SchemaHandler) (tb *map[string]*layout.Table, err error)

ss is []string

func Unmarshal

func Unmarshal(tableMap *map[string]*layout.Table, bgn int, end int, dstInterface interface{}, schemaHandler *schema.SchemaHandler, prefixPath string) (err error)

Convert the table map to objects slice. dstInterface is a slice of pointers of objects

Types

type KeyValue

type KeyValue struct {
	Key   reflect.Value
	Value reflect.Value
}

Record Map KeyValue pair

type MapRecord

type MapRecord struct {
	KeyValues []KeyValue
	Index     int
}

type Marshaler

type Marshaler interface {
	Marshal(node *Node, nodeBuf *NodeBufType) []*Node
}

//////for improve performance///////////////////////////////////

type Node

type Node struct {
	Val     reflect.Value
	PathMap *schema.PathMapType
	RL      int32
	DL      int32
}

type NodeBufType

type NodeBufType struct {
	Index int
	Buf   []*Node
}

Improve Performance/////////////////////////// NodeBuf

func NewNodeBuf

func NewNodeBuf(ln int) *NodeBufType

func (*NodeBufType) GetNode

func (nbt *NodeBufType) GetNode() *Node

func (*NodeBufType) Reset

func (nbt *NodeBufType) Reset()

type ParquetMap

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

func (*ParquetMap) Marshal

func (p *ParquetMap) Marshal(node *Node, nodeBuf *NodeBufType) []*Node

type ParquetMapStruct

type ParquetMapStruct struct{}

func (*ParquetMapStruct) Marshal

func (p *ParquetMapStruct) Marshal(node *Node, nodeBuf *NodeBufType) []*Node

type ParquetPtr

type ParquetPtr struct{}

func (*ParquetPtr) Marshal

func (p *ParquetPtr) Marshal(node *Node, nodeBuf *NodeBufType) []*Node

type ParquetSlice

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

func (*ParquetSlice) Marshal

func (p *ParquetSlice) Marshal(node *Node, nodeBuf *NodeBufType) []*Node

type ParquetStruct

type ParquetStruct struct{}

func (*ParquetStruct) Marshal

func (p *ParquetStruct) Marshal(node *Node, nodeBuf *NodeBufType) []*Node

type SliceRecord added in v1.4.0

type SliceRecord struct {
	Values []reflect.Value
	Index  int
}

Jump to

Keyboard shortcuts

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