agg

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AggregateSum = iota
	AggregateAvg
	AggregateMax
	AggregateMin
	AggregateCount
	AggregateStarCount
	AggregateApproxCountDistinct
	AggregateVariance
	AggregateBitAnd
	AggregateBitXor
	AggregateBitOr
	AggregateStdDevPop
	AggregateAnyValue
)

Variables

View Source
var Names = [...]string{
	AggregateSum:                 "sum",
	AggregateAvg:                 "avg",
	AggregateMax:                 "max",
	AggregateMin:                 "min",
	AggregateCount:               "count",
	AggregateStarCount:           "starcount",
	AggregateApproxCountDistinct: "approx_count_distinct",
	AggregateVariance:            "var",
	AggregateBitAnd:              "bit_and",
	AggregateBitXor:              "bit_xor",
	AggregateBitOr:               "bit_or",
	AggregateStdDevPop:           "stddev_pop",
	AggregateAnyValue:            "any",
}

Functions

func AnyValueReturnType added in v0.6.0

func AnyValueReturnType(typs []types.Type) types.Type

func ApproxCountReturnType added in v0.6.0

func ApproxCountReturnType(_ []types.Type) types.Type

func AvgReturnType added in v0.6.0

func AvgReturnType(typs []types.Type) types.Type

func BitAndReturnType added in v0.6.0

func BitAndReturnType(typs []types.Type) types.Type

func BitOrReturnType added in v0.6.0

func BitOrReturnType(_ []types.Type) types.Type

func BitXorReturnType added in v0.6.0

func BitXorReturnType(_ []types.Type) types.Type

func CountReturnType added in v0.6.0

func CountReturnType(_ []types.Type) types.Type

func MaxReturnType added in v0.6.0

func MaxReturnType(typs []types.Type) types.Type

func MinReturnType added in v0.6.0

func MinReturnType(typs []types.Type) types.Type

func ReturnType added in v0.6.0

func ReturnType(op int, typ types.Type) (types.Type, error)

ReturnType get aggregate operator's return type according to its operator-id and input-types.

func StdDevPopReturnType added in v0.6.0

func StdDevPopReturnType(typs []types.Type) types.Type

func String added in v0.6.0

func String(b []byte) (s string)

func SumReturnType added in v0.6.0

func SumReturnType(typs []types.Type) types.Type

func VarianceReturnType added in v0.6.0

func VarianceReturnType(typs []types.Type) types.Type

Types

type Agg

type Agg[T any] interface {
	encoding.BinaryMarshaler
	//encoding.BinaryUnmarshaler
	UnmarshalBinary(data []byte, m *mpool.MPool) error

	// Dup will duplicate a new agg with the same type.
	Dup() Agg[any]

	// Type return the type of the agg's result.
	OutputType() types.Type

	// InputType return the type of the agg's input.
	InputTypes() []types.Type

	// String return related information of the agg.
	// used to show query plans.
	String() string

	// Free the agg.
	Free(*mpool.MPool)

	// Grows allocates n groups for the agg.
	Grows(n int, m *mpool.MPool) error

	// Eval method calculates and returns the final result of the aggregate function.
	Eval(_ *mpool.MPool) (*vector.Vector, error)

	// Fill use the rowIndex-rows of vector to update the data of groupIndex-group.
	// rowCount indicates the number of times the rowIndex-row is repeated.
	Fill(groupIndex int64, rowIndex int64, rowCount int64, vecs []*vector.Vector) error

	// BulkFill use a whole vector to update the data of agg's group
	// groupIndex is the index number of the group
	// rowCounts is the count number of each row.
	BulkFill(groupIndex int64, rowCounts []int64, vecs []*vector.Vector) error

	// BatchFill use part of the vector to update the data of agg's group
	//      os(origin-s) records information about which groups need to be updated
	//      if length of os is N, we use first N of vps to do update work.
	//      And if os[i] > 0, it means the agg's (vps[i]-1)th group is a new one (never been assigned a value),
	//      Maybe this feature can help us to do some optimization work.
	//      So we use the os as a parameter but not len(os).
	//
	//      agg's (vps[i]-1)th group is related to vector's (offset+i)th row.
	//      rowCounts[i] is count number of the row[i]
	// For a more detailed introduction of rowCounts, please refer to comments of Function Fill.
	BatchFill(offset int64, os []uint8, vps []uint64, rowCounts []int64, vecs []*vector.Vector) error

	// Merge will merge a couple of group between 2 aggregate function structures.
	// It merges the groupIndex1-group of agg1 and
	// groupIndex2-group of agg2
	Merge(agg2 Agg[any], groupIndex1 int64, groupIndex2 int64) error

	// BatchMerge merges multi groups of agg1 and agg2
	//  agg1's (vps[i]-1)th group is related to agg2's (start+i)th group
	// For more introduction of os, please refer to comments of Function BatchFill.
	BatchMerge(agg2 Agg[any], start int64, os []uint8, vps []uint64) error

	// GetInputTypes get types of aggregate's input arguments.
	GetInputTypes() []types.Type

	// GetOperatorId get types of aggregate's aggregate id.
	GetOperatorId() int

	IsDistinct() bool

	// WildAggReAlloc reallocate for agg structure from memory pool.
	WildAggReAlloc(m *mpool.MPool) error
}

Agg agg interface

func New added in v0.6.0

func New(op int, dist bool, typ types.Type) (Agg[any], error)

func NewUnaryAgg

func NewUnaryAgg[T1, T2 any](op int, priv AggStruct, isCount bool, ityp, otyp types.Type, grows func(int),
	eval func([]T2) []T2, merge func(int64, int64, T2, T2, bool, bool, any) (T2, bool),
	fill func(int64, T1, T2, int64, bool, bool) (T2, bool),
	batchFill func(any, any, int64, int64, []uint64, []int64, *nulls.Nulls) error) Agg[*UnaryAgg[T1, T2]]

func NewUnaryDistAgg

func NewUnaryDistAgg[T1, T2 any](op int, priv AggStruct, isCount bool, ityp, otyp types.Type, grows func(int),
	eval func([]T2) []T2, merge func(int64, int64, T2, T2, bool, bool, any) (T2, bool),
	fill func(int64, T1, T2, int64, bool, bool) (T2, bool)) Agg[*UnaryDistAgg[T1, T2]]

type AggStruct added in v0.6.0

type AggStruct interface {
	encoding.BinaryMarshaler
	encoding.BinaryUnmarshaler
}

type Aggregate added in v0.6.0

type Aggregate struct {
	Op   int
	Dist bool
	E    *plan.Expr
}

type Anyvalue added in v0.6.0

type Anyvalue[T any] struct {
	NotSet []bool
}

func NewAnyValue added in v0.6.0

func NewAnyValue[T any]() *Anyvalue[T]

func (*Anyvalue[T]) Eval added in v0.6.0

func (a *Anyvalue[T]) Eval(vs []T) []T

func (*Anyvalue[T]) Fill added in v0.6.0

func (a *Anyvalue[T]) Fill(i int64, value T, ov T, z int64, isEmpty bool, isNull bool) (T, bool)

func (*Anyvalue[T]) Grows added in v0.6.0

func (a *Anyvalue[T]) Grows(size int)

func (*Anyvalue[T]) MarshalBinary added in v0.6.0

func (a *Anyvalue[T]) MarshalBinary() ([]byte, error)

func (*Anyvalue[T]) Merge added in v0.6.0

func (a *Anyvalue[T]) Merge(xIndex int64, yIndex int64, x T, y T, xEmpty bool, yEmpty bool, yAnyValue any) (T, bool)

func (*Anyvalue[T]) UnmarshalBinary added in v0.6.0

func (a *Anyvalue[T]) UnmarshalBinary(data []byte) error

type ApproxCountDistic added in v0.6.0

type ApproxCountDistic[T any] struct {
	Sk []*hll.Sketch
}

func NewApproxc added in v0.6.0

func NewApproxc[T any]() *ApproxCountDistic[T]

func (*ApproxCountDistic[T]) Eval added in v0.6.0

func (a *ApproxCountDistic[T]) Eval(vs []uint64) []uint64

func (*ApproxCountDistic[T]) Fill added in v0.6.0

func (a *ApproxCountDistic[T]) Fill(n int64, v1 T, v2 uint64, _ int64, isEmpty bool, isNull bool) (uint64, bool)

func (*ApproxCountDistic[T]) Grows added in v0.6.0

func (a *ApproxCountDistic[T]) Grows(n int)

func (*ApproxCountDistic[T]) MarshalBinary added in v0.6.0

func (a *ApproxCountDistic[T]) MarshalBinary() ([]byte, error)

func (*ApproxCountDistic[T]) Merge added in v0.6.0

func (a *ApproxCountDistic[T]) Merge(xIndex int64, yIndex int64, x uint64, _ uint64, xEmpty bool, yEmpty bool, yApxc any) (uint64, bool)

func (*ApproxCountDistic[T]) UnmarshalBinary added in v0.6.0

func (a *ApproxCountDistic[T]) UnmarshalBinary(data []byte) error

type Avg added in v0.6.0

type Avg[T Numeric] struct {
	Cnts []int64
}

func NewAvg added in v0.6.0

func NewAvg[T Numeric]() *Avg[T]

func (*Avg[T]) Eval added in v0.6.0

func (a *Avg[T]) Eval(vs []float64) []float64

func (*Avg[T]) Fill added in v0.6.0

func (a *Avg[T]) Fill(i int64, value T, ov float64, z int64, isEmpty bool, isNull bool) (float64, bool)

func (*Avg[T]) Grows added in v0.6.0

func (a *Avg[T]) Grows(cnt int)

func (*Avg[T]) MarshalBinary added in v0.6.0

func (a *Avg[T]) MarshalBinary() ([]byte, error)

func (*Avg[T]) Merge added in v0.6.0

func (a *Avg[T]) Merge(xIndex int64, yIndex int64, x float64, y float64, xEmpty bool, yEmpty bool, yAvg any) (float64, bool)

func (*Avg[T]) UnmarshalBinary added in v0.6.0

func (a *Avg[T]) UnmarshalBinary(data []byte) error

type BitAnd added in v0.6.0

type BitAnd[T1 types.Ints | types.UInts | types.Floats] struct {
}

func NewBitAnd added in v0.6.0

func NewBitAnd[T1 types.Ints | types.UInts | types.Floats]() *BitAnd[T1]

func (*BitAnd[T1]) Eval added in v0.6.0

func (ba *BitAnd[T1]) Eval(vs []uint64) []uint64

func (*BitAnd[T1]) Fill added in v0.6.0

func (ba *BitAnd[T1]) Fill(groupIndex int64, v1 T1, v2 uint64, z int64, isEmpty bool, hasNull bool) (uint64, bool)

func (*BitAnd[T1]) Grows added in v0.6.0

func (ba *BitAnd[T1]) Grows(_ int)

func (*BitAnd[T1]) MarshalBinary added in v0.6.0

func (ba *BitAnd[T1]) MarshalBinary() ([]byte, error)

func (*BitAnd[T1]) Merge added in v0.6.0

func (ba *BitAnd[T1]) Merge(groupIndex1, groupIndex2 int64, x, y uint64, isEmpty1 bool, isEmpty2 bool, agg any) (uint64, bool)

func (*BitAnd[T1]) UnmarshalBinary added in v0.6.0

func (ba *BitAnd[T1]) UnmarshalBinary(data []byte) error

type BitOr added in v0.6.0

type BitOr[T1 types.Ints | types.UInts | types.Floats] struct {
}

func NewBitOr added in v0.6.0

func NewBitOr[T1 types.Ints | types.UInts | types.Floats]() *BitOr[T1]

func (*BitOr[T1]) Eval added in v0.6.0

func (bo *BitOr[T1]) Eval(vs []uint64) []uint64

func (*BitOr[T1]) Fill added in v0.6.0

func (bo *BitOr[T1]) Fill(_ int64, v1 T1, v2 uint64, _ int64, IsEmpty bool, hasNull bool) (uint64, bool)

func (*BitOr[T1]) Grows added in v0.6.0

func (bo *BitOr[T1]) Grows(_ int)

func (*BitOr[T1]) MarshalBinary added in v0.6.0

func (bo *BitOr[T1]) MarshalBinary() ([]byte, error)

func (*BitOr[T1]) Merge added in v0.6.0

func (bo *BitOr[T1]) Merge(_, _ int64, x, y uint64, IsEmpty1 bool, IsEmpty2 bool, _ any) (uint64, bool)

func (*BitOr[T1]) UnmarshalBinary added in v0.6.0

func (bo *BitOr[T1]) UnmarshalBinary(data []byte) error

type BitXor added in v0.6.0

type BitXor[T1 types.Ints | types.UInts | types.Floats] struct {
}

func NewBitXor added in v0.6.0

func NewBitXor[T1 types.Ints | types.UInts | types.Floats]() *BitXor[T1]

func (*BitXor[T1]) Eval added in v0.6.0

func (bx *BitXor[T1]) Eval(vs []uint64) []uint64

func (*BitXor[T1]) Fill added in v0.6.0

func (bx *BitXor[T1]) Fill(_ int64, v1 T1, v2 uint64, z int64, IsEmpty bool, hasNull bool) (uint64, bool)

func (*BitXor[T1]) Grows added in v0.6.0

func (bx *BitXor[T1]) Grows(_ int)

func (*BitXor[T1]) MarshalBinary added in v0.6.0

func (bx *BitXor[T1]) MarshalBinary() ([]byte, error)

func (*BitXor[T1]) Merge added in v0.6.0

func (bx *BitXor[T1]) Merge(_, _ int64, x, y uint64, IsEmpty1 bool, IsEmpty2 bool, _ any) (uint64, bool)

func (*BitXor[T1]) UnmarshalBinary added in v0.6.0

func (bx *BitXor[T1]) UnmarshalBinary(data []byte) error

type BoolMax added in v0.6.0

type BoolMax struct {
}

func NewBoolMax added in v0.6.0

func NewBoolMax() *BoolMax

func (*BoolMax) Eval added in v0.6.0

func (m *BoolMax) Eval(vs []bool) []bool

func (*BoolMax) Fill added in v0.6.0

func (m *BoolMax) Fill(_ int64, value bool, ov bool, _ int64, isEmpty bool, isNull bool) (bool, bool)

func (*BoolMax) Grows added in v0.6.0

func (m *BoolMax) Grows(_ int)

func (*BoolMax) MarshalBinary added in v0.6.0

func (m *BoolMax) MarshalBinary() ([]byte, error)

func (*BoolMax) Merge added in v0.6.0

func (m *BoolMax) Merge(_ int64, _ int64, x bool, y bool, xEmpty bool, yEmpty bool, _ any) (bool, bool)

func (*BoolMax) UnmarshalBinary added in v0.6.0

func (m *BoolMax) UnmarshalBinary(data []byte) error

type BoolMin added in v0.6.0

type BoolMin struct {
}

func NewBoolMin added in v0.6.0

func NewBoolMin() *BoolMin

func (*BoolMin) Eval added in v0.6.0

func (m *BoolMin) Eval(vs []bool) []bool

func (*BoolMin) Fill added in v0.6.0

func (m *BoolMin) Fill(_ int64, value bool, ov bool, _ int64, isEmpty bool, isNull bool) (bool, bool)

func (*BoolMin) Grows added in v0.6.0

func (m *BoolMin) Grows(_ int)

func (*BoolMin) MarshalBinary added in v0.6.0

func (m *BoolMin) MarshalBinary() ([]byte, error)

func (*BoolMin) Merge added in v0.6.0

func (m *BoolMin) Merge(_ int64, _ int64, x bool, y bool, xEmpty bool, yEmpty bool, _ any) (bool, bool)

func (*BoolMin) UnmarshalBinary added in v0.6.0

func (m *BoolMin) UnmarshalBinary(data []byte) error

type Compare added in v0.6.0

type Count added in v0.6.0

type Count[T1 types.OrderedT | Decimal128AndString] struct {
	// IsStar is true: count(*)
	IsStar bool
}

func NewCount added in v0.6.0

func NewCount[T1 types.OrderedT | Decimal128AndString](isStar bool) *Count[T1]

func (*Count[T1]) Eval added in v0.6.0

func (c *Count[T1]) Eval(vs []int64) []int64

func (*Count[T1]) Fill added in v0.6.0

func (c *Count[T1]) Fill(_ int64, _ T1, v int64, z int64, _ bool, hasNull bool) (int64, bool)

func (*Count[T1]) Grows added in v0.6.0

func (c *Count[T1]) Grows(_ int)

func (*Count[T1]) MarshalBinary added in v0.6.0

func (c *Count[T1]) MarshalBinary() ([]byte, error)

func (*Count[T1]) Merge added in v0.6.0

func (c *Count[T1]) Merge(_, _ int64, x, y int64, _ bool, _ bool, _ any) (int64, bool)

func (*Count[T1]) UnmarshalBinary added in v0.6.0

func (c *Count[T1]) UnmarshalBinary(data []byte) error

type Decimal128AndString added in v0.6.0

type Decimal128AndString interface {
	types.Decimal | []byte | bool | types.Uuid
}

type Decimal128Avg added in v0.6.0

type Decimal128Avg struct {
	Cnts []int64
}

func NewD128Avg added in v0.6.0

func NewD128Avg() *Decimal128Avg

func (*Decimal128Avg) BatchFill added in v0.6.0

func (a *Decimal128Avg) BatchFill(rs, vs any, start, count int64, vps []uint64, zs []int64, nsp *nulls.Nulls) error

func (*Decimal128Avg) Eval added in v0.6.0

func (a *Decimal128Avg) Eval(vs []types.Decimal128) []types.Decimal128

func (*Decimal128Avg) Fill added in v0.6.0

func (a *Decimal128Avg) Fill(i int64, value types.Decimal128, ov types.Decimal128, z int64, isEmpty bool, isNull bool) (types.Decimal128, bool)

func (*Decimal128Avg) Grows added in v0.6.0

func (a *Decimal128Avg) Grows(cnt int)

func (*Decimal128Avg) MarshalBinary added in v0.6.0

func (a *Decimal128Avg) MarshalBinary() ([]byte, error)

func (*Decimal128Avg) Merge added in v0.6.0

func (a *Decimal128Avg) Merge(xIndex int64, yIndex int64, x types.Decimal128, y types.Decimal128, xEmpty bool, yEmpty bool, yAvg any) (types.Decimal128, bool)

func (*Decimal128Avg) UnmarshalBinary added in v0.6.0

func (a *Decimal128Avg) UnmarshalBinary(data []byte) error

type Decimal128Max added in v0.6.0

type Decimal128Max struct {
}

func NewD128Max added in v0.6.0

func NewD128Max() *Decimal128Max

func (*Decimal128Max) Eval added in v0.6.0

func (m *Decimal128Max) Eval(vs []types.Decimal128) []types.Decimal128

func (*Decimal128Max) Fill added in v0.6.0

func (m *Decimal128Max) Fill(_ int64, value types.Decimal128, ov types.Decimal128, _ int64, isEmpty bool, isNull bool) (types.Decimal128, bool)

func (*Decimal128Max) Grows added in v0.6.0

func (m *Decimal128Max) Grows(_ int)

func (*Decimal128Max) MarshalBinary added in v0.6.0

func (m *Decimal128Max) MarshalBinary() ([]byte, error)

func (*Decimal128Max) Merge added in v0.6.0

func (m *Decimal128Max) Merge(_ int64, _ int64, x types.Decimal128, y types.Decimal128, xEmpty bool, yEmpty bool, _ any) (types.Decimal128, bool)

func (*Decimal128Max) UnmarshalBinary added in v0.6.0

func (m *Decimal128Max) UnmarshalBinary(data []byte) error

type Decimal128Min added in v0.6.0

type Decimal128Min struct {
}

func NewD128Min added in v0.6.0

func NewD128Min() *Decimal128Min

func (*Decimal128Min) Eval added in v0.6.0

func (m *Decimal128Min) Eval(vs []types.Decimal128) []types.Decimal128

func (*Decimal128Min) Fill added in v0.6.0

func (m *Decimal128Min) Fill(_ int64, value types.Decimal128, ov types.Decimal128, _ int64, isEmpty bool, isNull bool) (types.Decimal128, bool)

func (*Decimal128Min) Grows added in v0.6.0

func (m *Decimal128Min) Grows(_ int)

func (*Decimal128Min) MarshalBinary added in v0.6.0

func (m *Decimal128Min) MarshalBinary() ([]byte, error)

func (*Decimal128Min) Merge added in v0.6.0

func (m *Decimal128Min) Merge(_ int64, _ int64, x types.Decimal128, y types.Decimal128, xEmpty bool, yEmpty bool, _ any) (types.Decimal128, bool)

func (*Decimal128Min) UnmarshalBinary added in v0.6.0

func (m *Decimal128Min) UnmarshalBinary(data []byte) error

type Decimal128Sum added in v0.6.0

type Decimal128Sum struct {
}

func NewD128Sum added in v0.6.0

func NewD128Sum() *Decimal128Sum

func (*Decimal128Sum) BatchFill added in v0.6.0

func (s *Decimal128Sum) BatchFill(rs, vs any, start, count int64, vps []uint64, zs []int64, nsp *nulls.Nulls) error

func (*Decimal128Sum) Eval added in v0.6.0

func (s *Decimal128Sum) Eval(vs []types.Decimal128) []types.Decimal128

func (*Decimal128Sum) Fill added in v0.6.0

func (s *Decimal128Sum) Fill(_ int64, value types.Decimal128, ov types.Decimal128, z int64, isEmpty bool, isNull bool) (types.Decimal128, bool)

func (*Decimal128Sum) Grows added in v0.6.0

func (s *Decimal128Sum) Grows(_ int)

func (*Decimal128Sum) MarshalBinary added in v0.6.0

func (s *Decimal128Sum) MarshalBinary() ([]byte, error)

func (*Decimal128Sum) Merge added in v0.6.0

func (s *Decimal128Sum) Merge(_ int64, _ int64, x types.Decimal128, y types.Decimal128, xEmpty bool, yEmpty bool, _ any) (types.Decimal128, bool)

func (*Decimal128Sum) UnmarshalBinary added in v0.6.0

func (s *Decimal128Sum) UnmarshalBinary(data []byte) error

type Decimal64Avg added in v0.6.0

type Decimal64Avg struct {
	Cnts []int64
}

func NewD64Avg added in v0.6.0

func NewD64Avg() *Decimal64Avg

func (*Decimal64Avg) BatchFill added in v0.6.0

func (a *Decimal64Avg) BatchFill(rs, vs any, start, count int64, vps []uint64, zs []int64, nsp *nulls.Nulls) error

func (*Decimal64Avg) Eval added in v0.6.0

func (a *Decimal64Avg) Eval(vs []types.Decimal128) []types.Decimal128

func (*Decimal64Avg) Fill added in v0.6.0

func (a *Decimal64Avg) Fill(i int64, value types.Decimal64, ov types.Decimal128, z int64, isEmpty bool, isNull bool) (types.Decimal128, bool)

func (*Decimal64Avg) Grows added in v0.6.0

func (a *Decimal64Avg) Grows(cnt int)

func (*Decimal64Avg) MarshalBinary added in v0.6.0

func (a *Decimal64Avg) MarshalBinary() ([]byte, error)

func (*Decimal64Avg) Merge added in v0.6.0

func (a *Decimal64Avg) Merge(xIndex int64, yIndex int64, x types.Decimal128, y types.Decimal128, xEmpty bool, yEmpty bool, yAvg any) (types.Decimal128, bool)

func (*Decimal64Avg) UnmarshalBinary added in v0.6.0

func (a *Decimal64Avg) UnmarshalBinary(data []byte) error

type Decimal64Max added in v0.6.0

type Decimal64Max struct {
}

func NewD64Max added in v0.6.0

func NewD64Max() *Decimal64Max

func (*Decimal64Max) Eval added in v0.6.0

func (m *Decimal64Max) Eval(vs []types.Decimal64) []types.Decimal64

func (*Decimal64Max) Fill added in v0.6.0

func (m *Decimal64Max) Fill(_ int64, value types.Decimal64, ov types.Decimal64, _ int64, isEmpty bool, isNull bool) (types.Decimal64, bool)

func (*Decimal64Max) Grows added in v0.6.0

func (m *Decimal64Max) Grows(_ int)

func (*Decimal64Max) MarshalBinary added in v0.6.0

func (m *Decimal64Max) MarshalBinary() ([]byte, error)

func (*Decimal64Max) Merge added in v0.6.0

func (m *Decimal64Max) Merge(_ int64, _ int64, x types.Decimal64, y types.Decimal64, xEmpty bool, yEmpty bool, _ any) (types.Decimal64, bool)

func (*Decimal64Max) UnmarshalBinary added in v0.6.0

func (m *Decimal64Max) UnmarshalBinary(data []byte) error

type Decimal64Min added in v0.6.0

type Decimal64Min struct {
}

func NewD64Min added in v0.6.0

func NewD64Min() *Decimal64Min

func (*Decimal64Min) Eval added in v0.6.0

func (m *Decimal64Min) Eval(vs []types.Decimal64) []types.Decimal64

func (*Decimal64Min) Fill added in v0.6.0

func (m *Decimal64Min) Fill(_ int64, value types.Decimal64, ov types.Decimal64, _ int64, isEmpty bool, isNull bool) (types.Decimal64, bool)

func (*Decimal64Min) Grows added in v0.6.0

func (m *Decimal64Min) Grows(_ int)

func (*Decimal64Min) MarshalBinary added in v0.6.0

func (m *Decimal64Min) MarshalBinary() ([]byte, error)

func (*Decimal64Min) Merge added in v0.6.0

func (m *Decimal64Min) Merge(_ int64, _ int64, x types.Decimal64, y types.Decimal64, xEmpty bool, yEmpty bool, _ any) (types.Decimal64, bool)

func (*Decimal64Min) UnmarshalBinary added in v0.6.0

func (m *Decimal64Min) UnmarshalBinary(data []byte) error

type Decimal64Sum added in v0.6.0

type Decimal64Sum struct {
}

func NewD64Sum added in v0.6.0

func NewD64Sum() *Decimal64Sum

func (*Decimal64Sum) BatchFill added in v0.6.0

func (s *Decimal64Sum) BatchFill(rs, vs any, start, count int64, vps []uint64, zs []int64, nsp *nulls.Nulls) error

func (*Decimal64Sum) Eval added in v0.6.0

func (s *Decimal64Sum) Eval(vs []types.Decimal64) []types.Decimal64

func (*Decimal64Sum) Fill added in v0.6.0

func (s *Decimal64Sum) Fill(_ int64, value types.Decimal64, ov types.Decimal64, z int64, isEmpty bool, isNull bool) (types.Decimal64, bool)

func (*Decimal64Sum) Grows added in v0.6.0

func (s *Decimal64Sum) Grows(_ int)

func (*Decimal64Sum) MarshalBinary added in v0.6.0

func (s *Decimal64Sum) MarshalBinary() ([]byte, error)

func (*Decimal64Sum) Merge added in v0.6.0

func (s *Decimal64Sum) Merge(_ int64, _ int64, x types.Decimal64, y types.Decimal64, xEmpty bool, yEmpty bool, _ any) (types.Decimal64, bool)

func (*Decimal64Sum) UnmarshalBinary added in v0.6.0

func (s *Decimal64Sum) UnmarshalBinary(data []byte) error

type EncodeAgg added in v0.6.0

type EncodeAgg struct {
	Op      int
	Private []byte
	Es      []bool
	Da      []byte

	InputTypes []byte
	OutputType []byte
	IsCount    bool
}

type EncodeAggDistinct added in v0.6.0

type EncodeAggDistinct[T any] struct {
	Op      int
	Private []byte
	Es      []bool
	Da      []byte

	InputType  []types.Type
	OutputType types.Type

	IsCount bool
	Srcs    [][]T
}

type EncodeDecimalV added in v0.6.0

type EncodeDecimalV struct {
	Sum    []types.Decimal128
	Counts []int64
}

type EncodeVariance added in v0.6.0

type EncodeVariance struct {
	Sum    []float64
	Counts []float64
}

type Max added in v0.6.0

type Max[T Compare] struct {
}

func NewMax added in v0.6.0

func NewMax[T Compare]() *Max[T]

func (*Max[T]) Eval added in v0.6.0

func (m *Max[T]) Eval(vs []T) []T

func (*Max[T]) Fill added in v0.6.0

func (m *Max[T]) Fill(_ int64, value T, ov T, _ int64, isEmpty bool, isNull bool) (T, bool)

func (*Max[T]) Grows added in v0.6.0

func (m *Max[T]) Grows(_ int)

func (*Max[T]) MarshalBinary added in v0.6.0

func (m *Max[T]) MarshalBinary() ([]byte, error)

func (*Max[T]) Merge added in v0.6.0

func (m *Max[T]) Merge(_ int64, _ int64, x T, y T, xEmpty bool, yEmpty bool, _ any) (T, bool)

func (*Max[T]) UnmarshalBinary added in v0.6.0

func (m *Max[T]) UnmarshalBinary(data []byte) error

type Min added in v0.6.0

type Min[T Compare] struct {
}

func NewMin added in v0.6.0

func NewMin[T Compare]() *Min[T]

func (*Min[T]) Eval added in v0.6.0

func (m *Min[T]) Eval(vs []T) []T

func (*Min[T]) Fill added in v0.6.0

func (m *Min[T]) Fill(_ int64, value T, ov T, _ int64, isEmpty bool, isNull bool) (T, bool)

func (*Min[T]) Grows added in v0.6.0

func (m *Min[T]) Grows(_ int)

func (*Min[T]) MarshalBinary added in v0.6.0

func (m *Min[T]) MarshalBinary() ([]byte, error)

func (*Min[T]) Merge added in v0.6.0

func (m *Min[T]) Merge(_ int64, _ int64, x T, y T, xEmpty bool, yEmpty bool, _ any) (T, bool)

func (*Min[T]) UnmarshalBinary added in v0.6.0

func (m *Min[T]) UnmarshalBinary(data []byte) error

type Numeric added in v0.6.0

type Numeric interface {
	types.Ints | types.UInts | types.Floats
}

type ReturnTyp added in v0.6.0

type ReturnTyp interface {
	uint64 | int64 | float64
}

if input type is int8/int16/int32/int64, the return type is int64 if input type is uint8/uint16/uint32/uint64, the return type is uint64 f input type is float32/float64, the return type is float64

type StdD128 added in v0.6.0

type StdD128 struct {
	Variance *VD128
}

func NewStdD128 added in v0.6.0

func NewStdD128() *StdD128

func (*StdD128) Eval added in v0.6.0

func (s *StdD128) Eval(vs []types.Decimal128) []types.Decimal128

func (*StdD128) Fill added in v0.6.0

func (s *StdD128) Fill(groupIndex int64, v1 types.Decimal128, v2 types.Decimal128, z int64, IsEmpty bool, hasNull bool) (types.Decimal128, bool)

func (*StdD128) Grows added in v0.6.0

func (s *StdD128) Grows(size int)

func (*StdD128) MarshalBinary added in v0.6.0

func (s *StdD128) MarshalBinary() ([]byte, error)

func (*StdD128) Merge added in v0.6.0

func (s *StdD128) Merge(groupIndex1, groupIndex2 int64, x, y types.Decimal128, IsEmpty1 bool, IsEmpty2 bool, agg any) (types.Decimal128, bool)

func (*StdD128) UnmarshalBinary added in v0.6.0

func (s *StdD128) UnmarshalBinary(data []byte) error

type StdD64 added in v0.6.0

type StdD64 struct {
	Variance *VD64
}

func NewStdD64 added in v0.6.0

func NewStdD64() *StdD64

func (*StdD64) Eval added in v0.6.0

func (s *StdD64) Eval(vs []types.Decimal128) []types.Decimal128

func (*StdD64) Fill added in v0.6.0

func (s *StdD64) Fill(groupIndex int64, v1 types.Decimal64, v2 types.Decimal128, z int64, IsEmpty bool, hasNull bool) (types.Decimal128, bool)

func (*StdD64) Grows added in v0.6.0

func (s *StdD64) Grows(size int)

func (*StdD64) MarshalBinary added in v0.6.0

func (s *StdD64) MarshalBinary() ([]byte, error)

func (*StdD64) Merge added in v0.6.0

func (s *StdD64) Merge(groupIndex1, groupIndex2 int64, x, y types.Decimal128, IsEmpty1 bool, IsEmpty2 bool, agg any) (types.Decimal128, bool)

func (*StdD64) UnmarshalBinary added in v0.6.0

func (s *StdD64) UnmarshalBinary(data []byte) error

type Stddevpop added in v0.6.0

type Stddevpop[T1 types.Floats | types.Ints | types.UInts] struct {
	Variance *Variance[T1]
}

func NewStdDevPop added in v0.6.0

func NewStdDevPop[T1 types.Floats | types.Ints | types.UInts]() *Stddevpop[T1]

NewStdDevPop is used to create a StdDevPop which supports float,int,uint

func (*Stddevpop[T1]) Eval added in v0.6.0

func (sdp *Stddevpop[T1]) Eval(vs []float64) []float64

func (*Stddevpop[T1]) Fill added in v0.6.0

func (sdp *Stddevpop[T1]) Fill(groupIndex int64, v1 T1, v2 float64, z int64, IsEmpty bool, hasNull bool) (float64, bool)

func (*Stddevpop[T1]) Grows added in v0.6.0

func (sdp *Stddevpop[T1]) Grows(sizes int)

func (*Stddevpop[T1]) MarshalBinary added in v0.6.0

func (sdp *Stddevpop[T1]) MarshalBinary() ([]byte, error)

func (*Stddevpop[T1]) Merge added in v0.6.0

func (sdp *Stddevpop[T1]) Merge(groupIndex1, groupIndex2 int64, x, y float64, IsEmpty1 bool, IsEmpty2 bool, agg any) (float64, bool)

func (*Stddevpop[T1]) UnmarshalBinary added in v0.6.0

func (sdp *Stddevpop[T1]) UnmarshalBinary(data []byte) error

type StrMax added in v0.6.0

type StrMax struct {
}

func NewStrMax added in v0.6.0

func NewStrMax() *StrMax

func (*StrMax) Eval added in v0.6.0

func (m *StrMax) Eval(vs [][]byte) [][]byte

func (*StrMax) Fill added in v0.6.0

func (m *StrMax) Fill(_ int64, value []byte, ov []byte, _ int64, isEmpty bool, isNull bool) ([]byte, bool)

func (*StrMax) Grows added in v0.6.0

func (m *StrMax) Grows(_ int)

func (*StrMax) MarshalBinary added in v0.6.0

func (m *StrMax) MarshalBinary() ([]byte, error)

func (*StrMax) Merge added in v0.6.0

func (m *StrMax) Merge(_ int64, _ int64, x []byte, y []byte, xEmpty bool, yEmpty bool, _ any) ([]byte, bool)

func (*StrMax) UnmarshalBinary added in v0.6.0

func (m *StrMax) UnmarshalBinary(data []byte) error

type StrMin added in v0.6.0

type StrMin struct {
}

func NewStrMin added in v0.6.0

func NewStrMin() *StrMin

func (*StrMin) Eval added in v0.6.0

func (m *StrMin) Eval(vs [][]byte) [][]byte

func (*StrMin) Fill added in v0.6.0

func (m *StrMin) Fill(_ int64, value []byte, ov []byte, _ int64, isEmpty bool, isNull bool) ([]byte, bool)

func (*StrMin) Grows added in v0.6.0

func (m *StrMin) Grows(_ int)

func (*StrMin) MarshalBinary added in v0.6.0

func (m *StrMin) MarshalBinary() ([]byte, error)

func (*StrMin) Merge added in v0.6.0

func (m *StrMin) Merge(_ int64, _ int64, x []byte, y []byte, xEmpty bool, yEmpty bool, _ any) ([]byte, bool)

func (*StrMin) UnmarshalBinary added in v0.6.0

func (m *StrMin) UnmarshalBinary(data []byte) error

type Sum added in v0.6.0

type Sum[T1 Numeric, T2 ReturnTyp] struct {
}

func NewSum added in v0.6.0

func NewSum[T1 Numeric, T2 ReturnTyp]() *Sum[T1, T2]

func (*Sum[T1, T2]) Eval added in v0.6.0

func (s *Sum[T1, T2]) Eval(vs []T2) []T2

func (*Sum[T1, T2]) Fill added in v0.6.0

func (s *Sum[T1, T2]) Fill(_ int64, value T1, ov T2, z int64, isEmpty bool, isNull bool) (T2, bool)

func (*Sum[T1, T2]) Grows added in v0.6.0

func (s *Sum[T1, T2]) Grows(_ int)

func (*Sum[T1, T2]) MarshalBinary added in v0.6.0

func (s *Sum[T1, T2]) MarshalBinary() ([]byte, error)

func (*Sum[T1, T2]) Merge added in v0.6.0

func (s *Sum[T1, T2]) Merge(_ int64, _ int64, x T2, y T2, xEmpty bool, yEmpty bool, _ any) (T2, bool)

func (*Sum[T1, T2]) UnmarshalBinary added in v0.6.0

func (s *Sum[T1, T2]) UnmarshalBinary(data []byte) error

type UnaryAgg

type UnaryAgg[T1, T2 any] struct {
	// contains filtered or unexported fields
}

UnaryAgg generic aggregation function with one input vector and without distinct

func (*UnaryAgg[T1, T2]) BatchFill

func (a *UnaryAgg[T1, T2]) BatchFill(start int64, os []uint8, vps []uint64, zs []int64, vecs []*vector.Vector) error

func (*UnaryAgg[T1, T2]) BatchMerge

func (a *UnaryAgg[T1, T2]) BatchMerge(b Agg[any], start int64, os []uint8, vps []uint64) error

func (*UnaryAgg[T1, T2]) BulkFill

func (a *UnaryAgg[T1, T2]) BulkFill(i int64, zs []int64, vecs []*vector.Vector) error

func (*UnaryAgg[T1, T2]) Dup

func (a *UnaryAgg[T1, T2]) Dup() Agg[any]

func (*UnaryAgg[T1, T2]) Eval

func (a *UnaryAgg[T1, T2]) Eval(m *mpool.MPool) (*vector.Vector, error)

func (*UnaryAgg[T1, T2]) Fill

func (a *UnaryAgg[T1, T2]) Fill(i int64, sel, z int64, vecs []*vector.Vector) error

func (*UnaryAgg[T1, T2]) Free

func (a *UnaryAgg[T1, T2]) Free(m *mpool.MPool)

func (*UnaryAgg[T1, T2]) GetInputTypes added in v0.6.0

func (a *UnaryAgg[T1, T2]) GetInputTypes() []types.Type

func (*UnaryAgg[T1, T2]) GetOperatorId added in v0.6.0

func (a *UnaryAgg[T1, T2]) GetOperatorId() int

func (*UnaryAgg[T1, T2]) Grows

func (a *UnaryAgg[T1, T2]) Grows(size int, m *mpool.MPool) error

func (*UnaryAgg[T1, T2]) InputTypes

func (a *UnaryAgg[T1, T2]) InputTypes() []types.Type

func (*UnaryAgg[T1, T2]) IsDistinct added in v0.6.0

func (a *UnaryAgg[T1, T2]) IsDistinct() bool

func (*UnaryAgg[T1, T2]) MarshalBinary added in v0.6.0

func (a *UnaryAgg[T1, T2]) MarshalBinary() ([]byte, error)

func (*UnaryAgg[T1, T2]) Merge

func (a *UnaryAgg[T1, T2]) Merge(b Agg[any], x, y int64) error

Merge a[x] += b[y]

func (*UnaryAgg[T1, T2]) OutputType

func (a *UnaryAgg[T1, T2]) OutputType() types.Type

func (*UnaryAgg[T1, T2]) String

func (a *UnaryAgg[T1, T2]) String() string

func (*UnaryAgg[T1, T2]) UnmarshalBinary added in v0.6.0

func (a *UnaryAgg[T1, T2]) UnmarshalBinary(data []byte, mp *mpool.MPool) error

func (*UnaryAgg[T1, T2]) WildAggReAlloc added in v0.6.0

func (a *UnaryAgg[T1, T2]) WildAggReAlloc(m *mpool.MPool) error

type UnaryDistAgg

type UnaryDistAgg[T1, T2 any] struct {
	// contains filtered or unexported fields
}

UnaryDistAgg generic aggregation function with one input vector and with distinct

func (*UnaryDistAgg[T1, T2]) BatchFill

func (a *UnaryDistAgg[T1, T2]) BatchFill(start int64, os []uint8, vps []uint64, zs []int64, vecs []*vector.Vector) error

func (*UnaryDistAgg[T1, T2]) BatchMerge

func (a *UnaryDistAgg[T1, T2]) BatchMerge(b Agg[any], start int64, os []uint8, vps []uint64) error

func (*UnaryDistAgg[T1, T2]) BulkFill

func (a *UnaryDistAgg[T1, T2]) BulkFill(i int64, zs []int64, vecs []*vector.Vector) error

func (*UnaryDistAgg[T1, T2]) Dup

func (a *UnaryDistAgg[T1, T2]) Dup() Agg[any]

func (*UnaryDistAgg[T1, T2]) Eval

func (a *UnaryDistAgg[T1, T2]) Eval(m *mpool.MPool) (*vector.Vector, error)

func (*UnaryDistAgg[T1, T2]) Fill

func (a *UnaryDistAgg[T1, T2]) Fill(i int64, sel, z int64, vecs []*vector.Vector) error

func (*UnaryDistAgg[T1, T2]) Free

func (a *UnaryDistAgg[T1, T2]) Free(m *mpool.MPool)

func (*UnaryDistAgg[T1, T2]) GetInputTypes added in v0.6.0

func (a *UnaryDistAgg[T1, T2]) GetInputTypes() []types.Type

func (*UnaryDistAgg[T1, T2]) GetOperatorId added in v0.6.0

func (a *UnaryDistAgg[T1, T2]) GetOperatorId() int

func (*UnaryDistAgg[T1, T2]) Grows

func (a *UnaryDistAgg[T1, T2]) Grows(size int, m *mpool.MPool) error

func (*UnaryDistAgg[T1, T2]) InputTypes

func (a *UnaryDistAgg[T1, T2]) InputTypes() []types.Type

func (*UnaryDistAgg[T1, T2]) IsDistinct added in v0.6.0

func (a *UnaryDistAgg[T1, T2]) IsDistinct() bool

func (*UnaryDistAgg[T1, T2]) MarshalBinary added in v0.6.0

func (a *UnaryDistAgg[T1, T2]) MarshalBinary() ([]byte, error)

func (*UnaryDistAgg[T1, T2]) Merge

func (a *UnaryDistAgg[T1, T2]) Merge(b Agg[any], x, y int64) error

Merge a[x] += b[y]

func (*UnaryDistAgg[T1, T2]) OutputType

func (a *UnaryDistAgg[T1, T2]) OutputType() types.Type

func (*UnaryDistAgg[T1, T2]) String

func (a *UnaryDistAgg[T1, T2]) String() string

func (*UnaryDistAgg[T1, T2]) UnmarshalBinary added in v0.6.0

func (a *UnaryDistAgg[T1, T2]) UnmarshalBinary(data []byte, m *mpool.MPool) error

func (*UnaryDistAgg[T1, T2]) WildAggReAlloc added in v0.6.0

func (a *UnaryDistAgg[T1, T2]) WildAggReAlloc(m *mpool.MPool) error

type UuidMax added in v0.6.0

type UuidMax struct {
}

func NewUuidMax added in v0.6.0

func NewUuidMax() *UuidMax

func (*UuidMax) Eval added in v0.6.0

func (m *UuidMax) Eval(vs []types.Uuid) []types.Uuid

func (*UuidMax) Fill added in v0.6.0

func (m *UuidMax) Fill(_ int64, value types.Uuid, ov types.Uuid, _ int64, isEmpty bool, isNull bool) (types.Uuid, bool)

func (*UuidMax) Grows added in v0.6.0

func (m *UuidMax) Grows(_ int)

func (*UuidMax) MarshalBinary added in v0.6.0

func (m *UuidMax) MarshalBinary() ([]byte, error)

func (*UuidMax) Merge added in v0.6.0

func (m *UuidMax) Merge(_ int64, _ int64, x types.Uuid, y types.Uuid, xEmpty bool, yEmpty bool, _ any) (types.Uuid, bool)

func (*UuidMax) UnmarshalBinary added in v0.6.0

func (m *UuidMax) UnmarshalBinary(data []byte) error

type UuidMin added in v0.6.0

type UuidMin struct {
}

func NewUuidMin added in v0.6.0

func NewUuidMin() *UuidMin

func (*UuidMin) Eval added in v0.6.0

func (m *UuidMin) Eval(vs []types.Uuid) []types.Uuid

func (*UuidMin) Fill added in v0.6.0

func (m *UuidMin) Fill(_ int64, value types.Uuid, ov types.Uuid, _ int64, isEmpty bool, isNull bool) (types.Uuid, bool)

func (*UuidMin) Grows added in v0.6.0

func (m *UuidMin) Grows(_ int)

func (*UuidMin) MarshalBinary added in v0.6.0

func (m *UuidMin) MarshalBinary() ([]byte, error)

func (*UuidMin) Merge added in v0.6.0

func (m *UuidMin) Merge(_ int64, _ int64, x types.Uuid, y types.Uuid, xEmpty bool, yEmpty bool, _ any) (types.Uuid, bool)

func (*UuidMin) UnmarshalBinary added in v0.6.0

func (m *UuidMin) UnmarshalBinary(data []byte) error

type VD128 added in v0.6.0

type VD128 struct {
	Sum    []types.Decimal128
	Counts []int64
}

VD128 Variance for decimal128

func NewVD128 added in v0.6.0

func NewVD128() *VD128

func (*VD128) Eval added in v0.6.0

func (v *VD128) Eval(vs []types.Decimal128) []types.Decimal128

func (*VD128) Fill added in v0.6.0

func (v *VD128) Fill(i int64, v1 types.Decimal128, v2 types.Decimal128, z int64, isEmpty bool, isNull bool) (types.Decimal128, bool)

func (*VD128) Grows added in v0.6.0

func (v *VD128) Grows(cnt int)

func (*VD128) MarshalBinary added in v0.6.0

func (v *VD128) MarshalBinary() ([]byte, error)

func (*VD128) Merge added in v0.6.0

func (v *VD128) Merge(xIndex, yIndex int64, x types.Decimal128, y types.Decimal128, xEmpty bool, yEmpty bool, agg any) (types.Decimal128, bool)

func (*VD128) UnmarshalBinary added in v0.6.0

func (v *VD128) UnmarshalBinary(data []byte) error

type VD64 added in v0.6.0

type VD64 struct {
	Sum    []types.Decimal128
	Counts []int64
}

VD64 Variance for decimal64

func NewVD64 added in v0.6.0

func NewVD64() *VD64

func (*VD64) Eval added in v0.6.0

func (v *VD64) Eval(vs []types.Decimal128) []types.Decimal128

func (*VD64) Fill added in v0.6.0

func (v *VD64) Fill(i int64, v1 types.Decimal64, v2 types.Decimal128, z int64, isEmpty bool, isNull bool) (types.Decimal128, bool)

func (*VD64) Grows added in v0.6.0

func (v *VD64) Grows(cnt int)

func (*VD64) MarshalBinary added in v0.6.0

func (v *VD64) MarshalBinary() ([]byte, error)

func (*VD64) Merge added in v0.6.0

func (v *VD64) Merge(xIndex, yIndex int64, x types.Decimal128, y types.Decimal128, xEmpty bool, yEmpty bool, agg any) (types.Decimal128, bool)

func (*VD64) UnmarshalBinary added in v0.6.0

func (v *VD64) UnmarshalBinary(data []byte) error

type Variance added in v0.6.0

type Variance[T1 types.Floats | types.Ints | types.UInts] struct {
	Sum    []float64
	Counts []float64
}

func NewVariance added in v0.6.0

func NewVariance[T1 types.Floats | types.Ints | types.UInts]() *Variance[T1]

NewVariance is used to create a Variance which supports float,int,uint

func (*Variance[T1]) Eval added in v0.6.0

func (variance *Variance[T1]) Eval(vs []float64) []float64

func (*Variance[T1]) Fill added in v0.6.0

func (variance *Variance[T1]) Fill(groupIndex int64, v1 T1, v2 float64, z int64, IsEmpty bool, hasNull bool) (float64, bool)

func (*Variance[T1]) Grows added in v0.6.0

func (variance *Variance[T1]) Grows(count int)

func (*Variance[T1]) MarshalBinary added in v0.6.0

func (variance *Variance[T1]) MarshalBinary() ([]byte, error)

func (*Variance[T1]) Merge added in v0.6.0

func (variance *Variance[T1]) Merge(groupIndex1, groupIndex2 int64, x, y float64, IsEmpty1 bool, IsEmpty2 bool, agg any) (float64, bool)

func (*Variance[T1]) UnmarshalBinary added in v0.6.0

func (variance *Variance[T1]) UnmarshalBinary(data []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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