column

package
v1.1.12 Latest Latest
Warning

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

Go to latest
Published: May 13, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Loader = loader.New()

Loader is the default loader to use for loading computed columns.

Functions

func IsValidName

func IsValidName(name string) bool

IsValidName validates the name of a column

Types

type Column

type Column = presto.Column

Column contract represent a column that can be appended.

func NewColumn

func NewColumn(t typeof.Type) Column

NewColumn creates a new appendable column

func NullColumn

func NullColumn(t typeof.Type, count int) Column

NullColumn creates a new null block

type Columns

type Columns map[string]Column

Columns represents a set of named columns

func MakeColumns

func MakeColumns(schema *typeof.Schema) Columns

MakeColumns initializes a columns based on schema if given

func (Columns) Any

func (c Columns) Any() Column

Any retrieves any column from the set.

func (Columns) Append

func (c Columns) Append(name string, value interface{}, typ typeof.Type) int

Append adds a value at a particular index to the block.

func (Columns) FillNulls

func (c Columns) FillNulls() (size int)

FillNulls adds nulls onto all uneven columns left.

func (Columns) LastRow

func (c Columns) LastRow() map[string]interface{}

LastRow returns the last row

func (Columns) Max

func (c Columns) Max() (max int)

Max finds the maximum count of a column in the set

func (Columns) Size

func (c Columns) Size() (size int)

Size returns the space (in bytes) required for the set of blocks.

type Computed

type Computed interface {
	Name() string
	Type() typeof.Type
	Value(map[string]interface{}) (interface{}, error)
}

Computed represents a computed column

func NewComputed

func NewComputed(name string, typ typeof.Type, uriOrCode string, loader *script.Loader) (Computed, error)

NewComputed creates a new script from a string

Jump to

Keyboard shortcuts

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