IPgMovingAggregate<TState, TArgs>
Namespace: Ankus
Assembly: Ankus.Runtime.dll
Maintains aggregate state as rows enter and leave a moving window.
public interface IPgMovingAggregate<TState, TArgs>Type parameters:
TState
The moving state, including SQL nullability.
TArgs
The aggregated inputs, with the same SQL types as the ordinary transition.
Methods
Section titled “Methods”MovingInverse(PgAggregateContext, TState, TArgs)
Section titled “MovingInverse(PgAggregateContext, TState, TArgs)”Removes a departing row, or requests recomputation by returning SQL NULL.
public static abstract TState MovingInverse(PgAggregateContext context, TState state, TArgs arguments)Parameters:
context — PgAggregateContext
The window invocation and state owner.
state — TState
The current moving state.
arguments — TArgs
The departing row’s inputs.
Returns: TState
The updated state, or SQL NULL when the declared state permits it.
MovingTransition(PgAggregateContext, TState, TArgs)
Section titled “MovingTransition(PgAggregateContext, TState, TArgs)”Incorporates an entering row and returns a present moving state.
public static abstract TState MovingTransition(PgAggregateContext context, TState state, TArgs arguments)Parameters:
context — PgAggregateContext
The window invocation and state owner.
state — TState
The current moving state.
arguments — TArgs
The entering row’s inputs.
Returns: TState
A present state; PostgreSQL rejects a SQL NULL forward result.