Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AggFunc ¶
type AggFunc interface { // AllocPartialResult allocates a specific data structure to store the // partial result, initializes it, and converts it to PartialResult to // return back. The second returned value is the memDelta used to trace // memory usage. Aggregate operator implementation, no matter it's a hash // or stream, should hold this allocated PartialResult for the further // operations like: "ResetPartialResult", "UpdatePartialResult". AllocPartialResult() (pr PartialResult, memDelta int64) // ResetPartialResult resets the partial result to the original state for a // specific aggregate function. It converts the input PartialResult to the // specific data structure which stores the partial result and then reset // every field to the proper original state. ResetPartialResult(pr PartialResult) // UpdatePartialResult updates the specific partial result for an aggregate // function using the input rows which all belonging to the same data group. // It converts the PartialResult to the specific data structure which stores // the partial result and then iterates on the input rows and update that // partial result according to the functionality and the state of the // aggregate function. The returned value is the memDelta used to trace memory // usage. UpdatePartialResult(sctx causetnetctx.Context, rowsInGroup []chunk.Row, pr PartialResult) (memDelta int64, err error) // MergePartialResult will be called in the final phase when parallelly // executing. It converts the PartialResult `src`, `dst` to the same specific // data structure which stores the partial results, and then evaluate the // final result using the partial results as input values. The returned value // is the memDelta used to trace memory usage. MergePartialResult(sctx causetnetctx.Context, src, dst PartialResult) (memDelta int64, err error) // AppendFinalResult2Chunk finalizes the partial result and append the // final result to the input chunk. Like other operations, it converts the // input PartialResult to the specific data structure which stores the // partial result and then calculates the final result and append that // final result to the chunk provided. AppendFinalResult2Chunk(sctx causetnetctx.Context, pr PartialResult, chk *chunk.Chunk) error }
AggFunc is the interface to evaluate the aggregate functions.
type PartialResult ¶
PartialResult represents data structure to store the partial result for the aggregate functions. Here we use unsafe.Pointer to allow the partial result to be any type.
type SlidingWindowAggFunc ¶
type SlidingWindowAggFunc interface { // Slide evaluates the aggregate functions using a sliding window. The input // lastStart and lastEnd are the interval of the former sliding window, // shiftStart, shiftEnd mean the sliding window offset. Note that the input // PartialResult stores the intermediate result which will be used in the next // sliding window, ensure call ResetPartialResult after a frame are evaluated // completely. Slide(sctx causetnetctx.Context, rows []chunk.Row, lastStart, lastEnd uint64, shiftStart, shiftEnd uint64, pr PartialResult) error }
SlidingWindowAggFunc is the interface to evaluate the aggregate functions using sliding window.
Click to show internal directories.
Click to hide internal directories.