uda

package
v2.3.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ColumnToFloat32

func ColumnToFloat32(cols io.ColumnInterface, name string) (outCol []float32, err error)

Types

type AggInterface

type AggInterface interface {
	FunctionInterface
	/*
		Returns the required arguments with a validator
		For example:
		  ca, am = New()
		  am.MapInputColumn("Price", "Bid", "Ask")
		  if am.Validate() { Init(args) }
	*/
	New() (AggInterface, *functions.ArgumentMap)
	/*
		Input arguments, followed by a custom set of arguments
	*/
	Init(args ...interface{}) error
	/*
		Accum() sends new data to the aggregate
	*/
	//Accum(ts []time.Time, rows io.Rows)
	Accum(io.ColumnInterface) error // The parameter is one of; ColumnSeries or Rows
	/*
		Output() returns the currently valid output of this aggregate
	*/
	Output() *io.ColumnSeries
	/*
		Reset() puts the aggregate state back to "new"
	*/
	Reset()
}

An aggregate is a function that takes rows as input and outputs a processed set of rows

The contract with the agg function is: the input rows must conform to the expected inputs of the agg, known to the caller. For example: If we have an agg that outputs "candles", there must be a column in the input rows that can be used to evaluate "Price". This must be a named column in the input. The output of the candler aggregate will always feature "Open, High, Low, Close", but may also feature summed values like "Volume" or averaged values like VWAP (volume weighted average price).

An agg has a set of "must have" input columns and can output a differing number of columns (and rows) depending on inputs.

type FunctionInterface

type FunctionInterface interface {
	GetRequiredArgs() []io.DataShape
	GetOptionalArgs() []io.DataShape
	GetInitArgs() []io.DataShape
}

TODO: This is where we break out a UDF API

type OrderedTime

type OrderedTime []time.Time

Sortable time slice

func (OrderedTime) Len

func (ot OrderedTime) Len() int

func (OrderedTime) Less

func (ot OrderedTime) Less(i, j int) bool

func (OrderedTime) Swap

func (ot OrderedTime) Swap(i, j int)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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