Documentation ¶
Index ¶
- Constants
- Variables
- func InitAggFramework(...)
- type Agg
- type AggStruct
- type Aggregate
- type EncodeAgg
- func (*EncodeAgg) Descriptor() ([]byte, []int)
- func (m *EncodeAgg) GetDa() []byte
- func (m *EncodeAgg) GetEs() []bool
- func (m *EncodeAgg) GetInputTypes() []byte
- func (m *EncodeAgg) GetIsCount() bool
- func (m *EncodeAgg) GetOp() int64
- func (m *EncodeAgg) GetOutputType() []byte
- func (m *EncodeAgg) GetPrivate() []byte
- func (m *EncodeAgg) Marshal() (dAtA []byte, err error)
- func (m *EncodeAgg) MarshalTo(dAtA []byte) (int, error)
- func (m *EncodeAgg) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*EncodeAgg) ProtoMessage()
- func (m *EncodeAgg) ProtoSize() (n int)
- func (m *EncodeAgg) Reset()
- func (m *EncodeAgg) String() string
- func (m *EncodeAgg) Unmarshal(dAtA []byte) error
- func (m *EncodeAgg) XXX_DiscardUnknown()
- func (m *EncodeAgg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *EncodeAgg) XXX_Merge(src proto.Message)
- func (m *EncodeAgg) XXX_Size() int
- func (m *EncodeAgg) XXX_Unmarshal(b []byte) error
- type EncodeAggDistinct
- type EncodeAggDistinctPB
- func (*EncodeAggDistinctPB) Descriptor() ([]byte, []int)
- func (m *EncodeAggDistinctPB) GetDa() []byte
- func (m *EncodeAggDistinctPB) GetEs() []bool
- func (m *EncodeAggDistinctPB) GetIsCount() bool
- func (m *EncodeAggDistinctPB) GetOp() int64
- func (m *EncodeAggDistinctPB) GetPrivate() []byte
- func (m *EncodeAggDistinctPB) Marshal() (dAtA []byte, err error)
- func (m *EncodeAggDistinctPB) MarshalTo(dAtA []byte) (int, error)
- func (m *EncodeAggDistinctPB) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*EncodeAggDistinctPB) ProtoMessage()
- func (m *EncodeAggDistinctPB) ProtoSize() (n int)
- func (m *EncodeAggDistinctPB) Reset()
- func (m *EncodeAggDistinctPB) String() string
- func (m *EncodeAggDistinctPB) Unmarshal(dAtA []byte) error
- func (m *EncodeAggDistinctPB) XXX_DiscardUnknown()
- func (m *EncodeAggDistinctPB) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *EncodeAggDistinctPB) XXX_Merge(src proto.Message)
- func (m *EncodeAggDistinctPB) XXX_Size() int
- func (m *EncodeAggDistinctPB) XXX_Unmarshal(b []byte) error
- type UnaryAgg
- func (a *UnaryAgg[T1, T2]) BatchFill(offset int64, groupStatus []uint8, groupOfRows []uint64, ...) (err error)
- func (a *UnaryAgg[T1, T2]) BatchMerge(b Agg[any], offset int64, groupStatus []uint8, groupIdxes []uint64) (err error)
- func (a *UnaryAgg[T1, T2]) BulkFill(groupIdx int64, vectors []*vector.Vector) (err error)
- func (a *UnaryAgg[T1, T2]) Dup(m *mpool.MPool) Agg[any]
- func (a *UnaryAgg[T1, T2]) Eval(pool *mpool.MPool) (vec *vector.Vector, err error)
- func (a *UnaryAgg[T1, T2]) Fill(groupIdx int64, rowIndex int64, vectors []*vector.Vector) (err error)
- func (a *UnaryAgg[T1, T2]) Free(pool *mpool.MPool)
- func (a *UnaryAgg[T1, T2]) GetOperatorId() int64
- func (a *UnaryAgg[T1, T2]) Grows(count int, pool *mpool.MPool) error
- func (a *UnaryAgg[T1, T2]) InputTypes() []types.Type
- func (a *UnaryAgg[T1, T2]) IsDistinct() bool
- func (a *UnaryAgg[T1, T2]) MarshalBinary() ([]byte, error)
- func (a *UnaryAgg[T1, T2]) Merge(b Agg[any], groupIdx1, groupIdx2 int64) (err error)
- func (a *UnaryAgg[T1, T2]) OutputType() types.Type
- func (agg *UnaryAgg[T1, T2]) SetPartialResult(PartialResult any)
- func (a *UnaryAgg[T1, T2]) UnmarshalBinary(data []byte) error
- func (a *UnaryAgg[T1, T2]) WildAggReAlloc(m *mpool.MPool) error
- type UnaryDistAgg
- func (a *UnaryDistAgg[T1, T2]) BatchFill(offset int64, groupStatus []uint8, groupOfRows []uint64, ...) (err error)
- func (a *UnaryDistAgg[T1, T2]) BatchMerge(b Agg[any], offset int64, groupStatus []uint8, groupIdxes []uint64) (err error)
- func (a *UnaryDistAgg[T1, T2]) BulkFill(groupIdx int64, vectors []*vector.Vector) (err error)
- func (a *UnaryDistAgg[T1, T2]) Dup(m *mpool.MPool) Agg[any]
- func (a *UnaryDistAgg[T1, T2]) Eval(pool *mpool.MPool) (vec *vector.Vector, err error)
- func (a *UnaryDistAgg[T1, T2]) Fill(groupIdx int64, rowIndex int64, vectors []*vector.Vector) (err error)
- func (a *UnaryDistAgg[T1, T2]) Free(pool *mpool.MPool)
- func (a *UnaryDistAgg[T1, T2]) GetOperatorId() int64
- func (a *UnaryDistAgg[T1, T2]) Grows(count int, pool *mpool.MPool) (err error)
- func (a *UnaryDistAgg[T1, T2]) InputTypes() []types.Type
- func (a *UnaryDistAgg[T1, T2]) IsDistinct() bool
- func (a *UnaryDistAgg[T1, T2]) MarshalBinary() ([]byte, error)
- func (a *UnaryDistAgg[T1, T2]) Merge(b Agg[any], groupIdx1, groupIdx2 int64) (err error)
- func (a *UnaryDistAgg[T1, T2]) OutputType() types.Type
- func (agg *UnaryDistAgg[T1, T2]) SetPartialResult(PartialResult any)
- func (a *UnaryDistAgg[T1, T2]) UnmarshalBinary(data []byte) error
- func (a *UnaryDistAgg[T1, T2]) WildAggReAlloc(m *mpool.MPool) error
Constants ¶
View Source
const (
GroupNotMatch = 0
)
Variables ¶
View Source
var ( ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") )
View Source
var IsWinOrderFun func(overloadID int64) bool
IsWinOrderFun check if the function is a window function.
View Source
var NewAgg func(overloadID int64, isDistinct bool, inputTypes []types.Type) (Agg[any], error)
NewAgg generate the aggregation related struct from the function overload id.
View Source
var NewAggWithConfig func(overloadID int64, isDistinct bool, inputTypes []types.Type, config any) (Agg[any], error)
NewAggWithConfig generate the aggregation related struct from the function overload id and deliver a config information.
Functions ¶
func InitAggFramework ¶ added in v1.0.0
Types ¶
type Agg ¶
type Agg[T any] interface { encoding.BinaryMarshaler encoding.BinaryUnmarshaler // OutputType return the result type of the agg. OutputType() types.Type // InputTypes return the input types of the agg. InputTypes() []types.Type // Free the agg. Free(pool *mpool.MPool) // Grows allocates n groups for the agg. Grows(n int, pool *mpool.MPool) error // Eval method calculates and returns the final result of the aggregate function. Eval(pool *mpool.MPool) (*vector.Vector, error) // Fill use the one row of vector to fill agg. Fill(groupIndex int64, rowIndex int64, vectors []*vector.Vector) error // BulkFill use whole vector to fill agg. BulkFill(groupIndex int64, vectors []*vector.Vector) error // BatchFill use part rows of the vector to fill agg. // the rows are start from offset and end at offset+len(groupStatus) // groupOfRows[i] is 1 means that the (i+offset)th row matched the first group and 0 means not matched. BatchFill(offset int64, groupStatus []uint8, groupOfRows []uint64, vectors []*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 // groupIdxes[i] is 1 means that the (offset + i)th group of agg2 matched the first group and 0 means not matched. BatchMerge(agg2 Agg[any], offset int64, groupStatus []uint8, groupIdxes []uint64) error // GetOperatorId get types of aggregate's aggregate id. GetOperatorId() int64 IsDistinct() bool Dup(m *mpool.MPool) Agg[any] // WildAggReAlloc reallocate for agg structure from memory pool. // todo: remove this method. WildAggReAlloc(m *mpool.MPool) error SetPartialResult(PartialResult any) }
Agg interface which return type is T.
func NewUnaryAgg ¶
func NewUnaryAgg[T1, T2 any]( overloadID int64, aggPrivateStructure AggStruct, isCount bool, inputTypes, outputType types.Type, grows func(int), eval func([]T2) ([]T2, error), merge func(int64, int64, T2, T2, bool, bool, any) (T2, bool, error), fill func(int64, T1, T2, int64, bool, bool) (T2, bool, error)) Agg[*UnaryAgg[T1, T2]]
func NewUnaryDistAgg ¶
func NewUnaryDistAgg[T1, T2 any]( op int64, priv AggStruct, isCount bool, ityp, otyp types.Type, grows func(int), eval func([]T2) ([]T2, error), merge func(int64, int64, T2, T2, bool, bool, any) (T2, bool, error), fill func(int64, T1, T2, int64, bool, bool) (T2, bool, error)) Agg[*UnaryDistAgg[T1, T2]]
type AggStruct ¶ added in v0.6.0
type AggStruct interface { encoding.BinaryMarshaler encoding.BinaryUnmarshaler Dup() AggStruct }
type EncodeAgg ¶ added in v0.6.0
type EncodeAgg struct { Op int64 Private []byte Es []bool Da []byte InputTypes []byte OutputType []byte IsCount bool }
func (*EncodeAgg) Descriptor ¶ added in v0.8.0
func (*EncodeAgg) GetInputTypes ¶ added in v0.8.0
func (*EncodeAgg) GetIsCount ¶ added in v0.8.0
func (*EncodeAgg) GetOutputType ¶ added in v0.8.0
func (*EncodeAgg) GetPrivate ¶ added in v0.8.0
func (*EncodeAgg) MarshalToSizedBuffer ¶ added in v0.8.0
func (*EncodeAgg) ProtoMessage ¶ added in v0.8.0
func (*EncodeAgg) ProtoMessage()
func (*EncodeAgg) XXX_DiscardUnknown ¶ added in v0.8.0
func (m *EncodeAgg) XXX_DiscardUnknown()
func (*EncodeAgg) XXX_Marshal ¶ added in v0.8.0
func (*EncodeAgg) XXX_Unmarshal ¶ added in v0.8.0
type EncodeAggDistinct ¶ added in v0.6.0
type EncodeAggDistinct[T any] struct { Op int64 Private []byte Es []bool Da []byte InputTypes []types.Type OutputType types.Type IsCount bool Srcs [][]T }
func (*EncodeAggDistinct[T]) MarshalBinary ¶ added in v0.8.0
func (m *EncodeAggDistinct[T]) MarshalBinary() ([]byte, error)
func (*EncodeAggDistinct[T]) UnmarshalBinary ¶ added in v0.8.0
func (m *EncodeAggDistinct[T]) UnmarshalBinary(data []byte) error
type EncodeAggDistinctPB ¶ added in v0.8.0
type EncodeAggDistinctPB struct { Op int64 `protobuf:"varint,1,opt,name=Op,proto3,casttype=int64" json:"Op,omitempty"` Private []byte `protobuf:"bytes,2,opt,name=Private,proto3" json:"Private,omitempty"` Es []bool `protobuf:"varint,3,rep,packed,name=Es,proto3" json:"Es,omitempty"` Da []byte `protobuf:"bytes,4,opt,name=Da,proto3" json:"Da,omitempty"` InputTypes []github_com_matrixorigin_matrixone_pkg_container_types.Type `` /* 133-byte string literal not displayed */ OutputType github_com_matrixorigin_matrixone_pkg_container_types.Type `` /* 133-byte string literal not displayed */ IsCount bool `protobuf:"varint,7,opt,name=IsCount,proto3" json:"IsCount,omitempty"` }
func (*EncodeAggDistinctPB) Descriptor ¶ added in v0.8.0
func (*EncodeAggDistinctPB) Descriptor() ([]byte, []int)
func (*EncodeAggDistinctPB) GetDa ¶ added in v0.8.0
func (m *EncodeAggDistinctPB) GetDa() []byte
func (*EncodeAggDistinctPB) GetEs ¶ added in v0.8.0
func (m *EncodeAggDistinctPB) GetEs() []bool
func (*EncodeAggDistinctPB) GetIsCount ¶ added in v0.8.0
func (m *EncodeAggDistinctPB) GetIsCount() bool
func (*EncodeAggDistinctPB) GetOp ¶ added in v0.8.0
func (m *EncodeAggDistinctPB) GetOp() int64
func (*EncodeAggDistinctPB) GetPrivate ¶ added in v0.8.0
func (m *EncodeAggDistinctPB) GetPrivate() []byte
func (*EncodeAggDistinctPB) Marshal ¶ added in v0.8.0
func (m *EncodeAggDistinctPB) Marshal() (dAtA []byte, err error)
func (*EncodeAggDistinctPB) MarshalTo ¶ added in v0.8.0
func (m *EncodeAggDistinctPB) MarshalTo(dAtA []byte) (int, error)
func (*EncodeAggDistinctPB) MarshalToSizedBuffer ¶ added in v0.8.0
func (m *EncodeAggDistinctPB) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*EncodeAggDistinctPB) ProtoMessage ¶ added in v0.8.0
func (*EncodeAggDistinctPB) ProtoMessage()
func (*EncodeAggDistinctPB) ProtoSize ¶ added in v0.8.0
func (m *EncodeAggDistinctPB) ProtoSize() (n int)
func (*EncodeAggDistinctPB) Reset ¶ added in v0.8.0
func (m *EncodeAggDistinctPB) Reset()
func (*EncodeAggDistinctPB) String ¶ added in v0.8.0
func (m *EncodeAggDistinctPB) String() string
func (*EncodeAggDistinctPB) Unmarshal ¶ added in v0.8.0
func (m *EncodeAggDistinctPB) Unmarshal(dAtA []byte) error
func (*EncodeAggDistinctPB) XXX_DiscardUnknown ¶ added in v0.8.0
func (m *EncodeAggDistinctPB) XXX_DiscardUnknown()
func (*EncodeAggDistinctPB) XXX_Marshal ¶ added in v0.8.0
func (m *EncodeAggDistinctPB) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*EncodeAggDistinctPB) XXX_Merge ¶ added in v0.8.0
func (m *EncodeAggDistinctPB) XXX_Merge(src proto.Message)
func (*EncodeAggDistinctPB) XXX_Size ¶ added in v0.8.0
func (m *EncodeAggDistinctPB) XXX_Size() int
func (*EncodeAggDistinctPB) XXX_Unmarshal ¶ added in v0.8.0
func (m *EncodeAggDistinctPB) XXX_Unmarshal(b []byte) error
type UnaryAgg ¶
UnaryAgg generic aggregation function with one input vector and without distinct
func (*UnaryAgg[T1, T2]) BatchMerge ¶
func (*UnaryAgg[T1, T2]) GetOperatorId ¶ added in v0.6.0
func (*UnaryAgg[T1, T2]) InputTypes ¶
func (*UnaryAgg[T1, T2]) IsDistinct ¶ added in v0.6.0
func (*UnaryAgg[T1, T2]) MarshalBinary ¶ added in v0.6.0
func (*UnaryAgg[T1, T2]) OutputType ¶
func (*UnaryAgg[T1, T2]) SetPartialResult ¶ added in v1.1.0
func (*UnaryAgg[T1, T2]) UnmarshalBinary ¶ added in v0.6.0
type UnaryDistAgg ¶
type UnaryDistAgg[T1, T2 any] struct { PartialResult any // contains filtered or unexported fields }
UnaryDistAgg generic aggregation function with one input vector and with distinct
func (*UnaryDistAgg[T1, T2]) BatchMerge ¶
func (*UnaryDistAgg[T1, T2]) BulkFill ¶
func (a *UnaryDistAgg[T1, T2]) BulkFill(groupIdx int64, vectors []*vector.Vector) (err error)
func (*UnaryDistAgg[T1, T2]) Dup ¶
func (a *UnaryDistAgg[T1, T2]) Dup(m *mpool.MPool) Agg[any]
todo need improve performance
func (*UnaryDistAgg[T1, T2]) Free ¶
func (a *UnaryDistAgg[T1, T2]) Free(pool *mpool.MPool)
func (*UnaryDistAgg[T1, T2]) GetOperatorId ¶ added in v0.6.0
func (a *UnaryDistAgg[T1, T2]) GetOperatorId() int64
func (*UnaryDistAgg[T1, T2]) Grows ¶
func (a *UnaryDistAgg[T1, T2]) Grows(count int, pool *mpool.MPool) (err 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], groupIdx1, groupIdx2 int64) (err error)
Merge a[x] += b[y]
func (*UnaryDistAgg[T1, T2]) OutputType ¶
func (a *UnaryDistAgg[T1, T2]) OutputType() types.Type
func (*UnaryDistAgg[T1, T2]) SetPartialResult ¶ added in v1.1.0
func (agg *UnaryDistAgg[T1, T2]) SetPartialResult(PartialResult any)
func (*UnaryDistAgg[T1, T2]) UnmarshalBinary ¶ added in v0.6.0
func (a *UnaryDistAgg[T1, T2]) UnmarshalBinary(data []byte) error
func (*UnaryDistAgg[T1, T2]) WildAggReAlloc ¶ added in v0.6.0
func (a *UnaryDistAgg[T1, T2]) WildAggReAlloc(m *mpool.MPool) error
Click to show internal directories.
Click to hide internal directories.