uda

package
v4.1.23 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 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)

ColumnToFloat32 converts the specified column to a slice of float32. nolint: dupl // generics can make the code slower

func ColumnToFloat64

func ColumnToFloat64(cols io.ColumnInterface, name string) (outCol []float64, err error)

ColumnToFloat64 converts the specified column to a slice of float64. nolint: dupl // generics can make the code slower

Types

type AggInterface

type AggInterface interface {
	FunctionInterface
	/*
		Input arguments, followed by a custom set of arguments
	*/
	New(argMap *functions.ArgumentMap, args ...interface{}) (AggInterface, error)

	/*
		Accum() sends new data to the aggregate
		and returns the currently valid output of this aggregate
	*/
	// Accum(ts []time.Time, rows io.Rows)
	// The io.ColumnInterface parameter is one of; ColumnSeries or Rows
	Accum(io.TimeBucketKey, *functions.ArgumentMap, io.ColumnInterface) (*io.ColumnSeries, error)
}

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