Documentation ¶
Index ¶
- Constants
- func Marshal(srcInterface []interface{}, schemaHandler *schema.SchemaHandler) (tb *map[string]*layout.Table, err error)
- func MarshalArrow(records []interface{}, schemaHandler *schema.SchemaHandler) (*map[string]*layout.Table, error)
- func MarshalCSV(records []interface{}, schemaHandler *schema.SchemaHandler) (*map[string]*layout.Table, error)
- func MarshalFast(srcInterface []interface{}, schemaHandler *schema.SchemaHandler) (tb *map[string]*layout.Table, err error)
- func MarshalJSON(ss []interface{}, schemaHandler *schema.SchemaHandler) (tb *map[string]*layout.Table, err error)
- func MarshalProto(srcInterface []interface{}, schemaHandler *schema.SchemaHandler) (tb *map[string]*layout.Table, err error)
- func MarshalStruct(srcInterface []interface{}, schemaHandler *schema.SchemaHandler, isProto bool) (tb *map[string]*layout.Table, err error)
- func Unmarshal(tableMap *map[string]*layout.Table, bgn int, end int, dstInterface interface{}, ...) (err error)
- type KeyValue
- type MapRecord
- type Marshaler
- type Node
- type NodeBufType
- type ParquetInterface
- type ParquetMap
- type ParquetMapStruct
- type ParquetPtr
- type ParquetSlice
- type ParquetStruct
- type ParquetTimestamp
- type SliceRecord
Constants ¶
const ProtoNanosName = "Nanos"
const ProtoSecondsName = "Seconds"
Variables ¶
This section is empty.
Functions ¶
func MarshalArrow ¶
func MarshalArrow(records []interface{}, schemaHandler *schema.SchemaHandler) (*map[string]*layout.Table, 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 MarshalFast ¶
func MarshalFast(srcInterface []interface{}, schemaHandler *schema.SchemaHandler) (tb *map[string]*layout.Table, err error)
MarshalFast implements the Marshal function while maximizing performance and minimizing allocations.
For each type it attempts to marshal, it uses reflection to compile an encoder. Then, for each element, it looks up the encoder for the type and encodes it by walking the pointers of the structure, appending leaf elements into their respective tables.
This function makes liberal use of the unsafe package to avoid allocations when performing normal reflection. It also uses the "github.com/goccy/go-reflect" package (a drop-in alternative to the normal "reflect" package) to make use of some additional features. (Namely TypeID and TypeAndPtrOf.)
It does not support map-type fields. It should support every other use-case of Marshal.
func MarshalJSON ¶
func MarshalJSON(ss []interface{}, schemaHandler *schema.SchemaHandler) (tb *map[string]*layout.Table, err error)
ss is []string
func MarshalProto ¶
func MarshalProto(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 MarshalStruct ¶
func MarshalStruct(srcInterface []interface{}, schemaHandler *schema.SchemaHandler, isProto bool) (tb *map[string]*layout.Table, err error)
Convert the objects to table map. srcInterface is a slice of objects
Types ¶
type Marshaler ¶
type Marshaler interface {
Marshal(node *Node, nodeBuf *NodeBufType, stack []*Node) (newStack []*Node)
}
//////for improve performance///////////////////////////////////
type NodeBufType ¶
Improve Performance/////////////////////////// NodeBuf
func InitMarshal ¶
func InitMarshal(srcInterface []interface{}, schemaHandler *schema.SchemaHandler) (*reflect.Value, *NodeBufType, map[string]*layout.Table)
func NewNodeBuf ¶
func NewNodeBuf(ln int) *NodeBufType
func (*NodeBufType) GetNode ¶
func (nbt *NodeBufType) GetNode() *Node
func (*NodeBufType) Reset ¶
func (nbt *NodeBufType) Reset()
type ParquetInterface ¶ added in v1.0.3
type ParquetInterface struct{}
func (*ParquetInterface) Marshal ¶ added in v1.0.3
func (p *ParquetInterface) Marshal(node *Node, nodeBuf *NodeBufType, stack []*Node) []*Node
For interface value, it doesn't introduce additional definition level since it's just proxy to the pointer of object. But the pointer of the object will introduce additional definition level
type ParquetMap ¶
type ParquetMap struct {
// contains filtered or unexported fields
}
func (*ParquetMap) Marshal ¶
func (p *ParquetMap) Marshal(node *Node, nodeBuf *NodeBufType, stack []*Node) []*Node
type ParquetMapStruct ¶
type ParquetMapStruct struct {
// contains filtered or unexported fields
}
func (*ParquetMapStruct) Marshal ¶
func (p *ParquetMapStruct) Marshal(node *Node, nodeBuf *NodeBufType, stack []*Node) []*Node
type ParquetPtr ¶
type ParquetPtr struct{}
func (*ParquetPtr) Marshal ¶
func (p *ParquetPtr) Marshal(node *Node, nodeBuf *NodeBufType, stack []*Node) []*Node
type ParquetSlice ¶
type ParquetSlice struct {
// contains filtered or unexported fields
}
func (*ParquetSlice) Marshal ¶
func (p *ParquetSlice) Marshal(node *Node, nodeBuf *NodeBufType, stack []*Node) []*Node
type ParquetStruct ¶
type ParquetStruct struct{}
func (*ParquetStruct) Marshal ¶
func (p *ParquetStruct) Marshal(node *Node, nodeBuf *NodeBufType, stack []*Node) []*Node
type ParquetTimestamp ¶
type ParquetTimestamp struct{}
func (*ParquetTimestamp) Marshal ¶
func (p *ParquetTimestamp) Marshal(node *Node, nodeBuf *NodeBufType, stack []*Node) []*Node
Marshal the proto timestamp into milliseconds