dataframe

package
v0.0.0-...-58ddf24 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

README

dataframe

Testing

This package uses golden files to verify Arrow serialization.

Add the update flag to go test to update the golden files:

go test -update

Make sure you check in any updated golden files.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalArrow

func MarshalArrow(f *Frame) ([]byte, error)

MarshalArrow converts the Frame to an arrow table and returns a byte representation of that table.

Types

type Field

type Field struct {
	Name   string
	Type   FieldType
	Vector Vector
}

Field represents a column of data with a specific type.

func NewField

func NewField(name string, fieldType FieldType, values interface{}) *Field

NewField returns a new instance of Field.

func (*Field) Len

func (f *Field) Len() int

Len returns the number of elements in the field.

type FieldType

type FieldType int

FieldType is used to describe the type of data in a field.

const (
	FieldTypeOther FieldType = iota
	FieldTypeTime
	FieldTypeNumber
	FieldTypeString
	FieldTypeBoolean
)

All valid field types.

func (FieldType) String

func (f FieldType) String() string

type Fields

type Fields []*Field

type Frame

type Frame struct {
	Name   string
	Labels Labels
	Fields []*Field

	RefID string
}

Frame represents a columnar storage with optional labels.

func New

func New(name string, labels Labels, fields ...*Field) *Frame

New returns a new instance of a Frame.

func (*Frame) Rows

func (f *Frame) Rows() int

Rows returns the number of rows in the frame.

type Labels

type Labels map[string]string

Labels are used to add metadata to an object.

func (Labels) Contains

func (l Labels) Contains(arg Labels) bool

Contains returns true if all k=v pairs of the argument are in the receiver.

func (Labels) Equals

func (l Labels) Equals(arg Labels) bool

Equals returns true if the argument has the same k=v pairs as the receiver.

func (Labels) String

func (l Labels) String() string

type Vector

type Vector interface {
	Set(idx int, i interface{})
	At(i int) interface{}
	Len() int
}

Vector represents a collection of Elements.

Jump to

Keyboard shortcuts

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