Class AggregateTransform<TInput, TAccumulate, TOutput>
A dataflow worker that uses callbacks to aggregate incoming rows, and optionally an equality comparer to group incoming rows. It outputs at most one row for all input rows or per unique grouping. The input rows, the accumulation, and the output row (if any) can all have different types.
Note: Use the factory methods in AggregateTransformFactory to create instances of this class. Also see the examples in Dataflow Aggregations.
Also see the examples in Dataflow Aggregations,
which cover IAggregationCommand predefined column aggregations (Sum,
Average etc.), RowAggregationFunction predefined row aggregations
(First, Last etc.), IGroupByCommand and IGroupByCopyCommand
GROUP BY commands, as well as creating custom aggregations and groupings.
Note that all dataflow workers must adhere to the Row Ownership rules.
This worker is fully blocking, i.e. it will only output row(s) after it has received all incoming rows. It will buffer (and therefore consume memory for) only a single accumulation (without grouping), or multiple accumulations corresponding to the number of unique groupings.
Inheritance
Implements
Inherited Members
Namespace: actionETL
Assembly: actionETL.dll
Syntax
public class AggregateTransform<TInput, TAccumulate, TOutput> : WorkerBase<AggregateTransform<TInput, TAccumulate, TOutput>>, IDisposeOnFinished where TInput : class where TOutput : class
Type Parameters
| Name | Description |
|---|---|
| TInput | The type of the input rows. |
| TAccumulate | The type of the accumulation seed. Can be a value type or a reference type. |
| TOutput | The type of the output row. |
Properties
Input
Gets the input port for consuming rows from the upstream worker.
Declaration
public InputPort<TInput> Input { get; }
Property Value
| Type | Description |
|---|---|
| InputPort<TInput> |
Output
Gets the output port for sending rows to the downstream worker.
Declaration
public OutputPort<TOutput> Output { get; }
Property Value
| Type | Description |
|---|---|
| OutputPort<TOutput> |
Methods
RunAsync()
This method can be overridden to add custom functionality to the derived worker that runs before
and after the row processing. In this case, the base class base.RunAsync() must
be called for the worker to function correctly.
Typically, this worker is used without overriding this method.
Declaration
protected override Task<OutcomeStatus> RunAsync()
Returns
| Type | Description |
|---|---|
| Task<OutcomeStatus> | A |