_test

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadJsonSchema

func LoadJsonSchema(path string) ([]byte, error)

/ Load Schema in JSON format and convert to arrow schema in serialized bytes

func SerializeAsArrowSchema

func SerializeAsArrowSchema(schema *_Schema) ([]byte, error)

func ToArrowField

func ToArrowField(f FieldWrapper) arrow.Field

Types

type Array

type Array struct {
	Name     string        `json:"name"`
	Count    int           `json:"count"`
	Valids   []int         `json:"VALIDITY,omitempty"`
	Data     []interface{} `json:"DATA,omitempty"`
	Offset   []int32       `json:"OFFSET,omitempty"`
	Children []Array       `json:"children,omitempty"`
}

type Field

type Field struct {
	ID        uint       `json:"id"`
	Unicode   rune       `json:"unicode"`
	Marker    fbs.Marker `json:"marker"`
	Deprecate bool       `json:"deprecate"`

	Name string `json:"name"`

	// leave this as a json RawMessage in order to partially unmarshal as needed
	// during marshal/unmarshal time so we can determine what the structure is
	// actually expected to be.
	//Type      json.RawMessage `json:"type"`
	Type     string         `json:"type"`
	Nullable bool           `json:"nullable"`
	Children []FieldWrapper `json:"children"`

	Metadata []metaKV `json:"metadata,omitempty"`
	// contains filtered or unexported fields
}

type FieldWrapper

type FieldWrapper struct {
	Field
}

FieldWrapper gets used in order to hook into the JSON marshalling and unmarshalling without creating an infinite loop when dealing with the children fields.

func FromArrowField

func FromArrowField(arrowField arrow.Field) FieldWrapper

func (FieldWrapper) MarshalJSON

func (f FieldWrapper) MarshalJSON() ([]byte, error)

func (*FieldWrapper) UnmarshalJSON

func (f *FieldWrapper) UnmarshalJSON(data []byte) error

type Record

type Record struct {
	Count   int64   `json:"count"`
	Columns []Array `json:"columns"`
}

Jump to

Keyboard shortcuts

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