Class SortTransformFactory
Factory methods that create a
SortTransform<TInputOutput>
dataflow worker, with one Input port and one Output port, which sorts the incoming
rows, optionally removing duplicates, before passing them to the downstream worker.
The Input port is linked to (if available) the upstream
output or error output port specified by the factory.
Get the factory from Link when the upstream port is known ahead of time (which is usually the case). Otherwise get it from GetDownstreamFactory<TInput>(), and link the transform or target explicitly using LinkTo(InputPort<TOutput>) or LinkFrom(OutputPortBase<TInput>).
SortTransform uses an in-memory sort. This is a fully blocking transform, i.e. it must receive
and buffer all rows before outputting any rows, which can consume large amounts of memory.
Please see
Buffering and Memory Consumption
for more details.
The sort algorithm is unstable, i.e. two rows that compare as equal are not guaranteed to keep their relative ordering.
Namespace: actionETL
Assembly: actionETL.dll
Syntax
public static class SortTransformFactory
Methods
SortTransform<TInputOutput>(in DownstreamFactory<TInputOutput>, String)
Initializes a new instance of the SortTransform<TInputOutput> dataflow worker, which sorts the incoming rows, optionally removing duplicates.
The default comparer will be used, which requires that TInputOutput implements
IComparable<T> or IComparable.
The Input port is linked to (if available) the upstream
output or error output port specified by the factory.
Declaration
public static SortTransform<TInputOutput> SortTransform<TInputOutput>(this in DownstreamFactory<TInputOutput> downstreamFactory, string workerName)
where TInputOutput : class
Parameters
| Type | Name | Description |
|---|---|---|
| DownstreamFactory<TInputOutput> | downstreamFactory | The downstream factory, which specifies the parent worker and (optionally) the upstream port to link the "first" input port of this dataflow worker to. Get it from Link when the upstream port is known ahead of time (which is usually the case). Otherwise get it from GetDownstreamFactory<TInput>(), and link the transform or target explicitly using LinkTo(InputPort<TOutput>) or LinkFrom(OutputPortBase<TInput>). |
| String | workerName | Name of the worker.
Set to a prefix plus a trailing
While less useful, set to
The name cannot otherwise contain |
Returns
| Type | Description |
|---|---|
| SortTransform<TInputOutput> | The newly created and (optionally) linked worker. |
Type Parameters
| Name | Description |
|---|---|
| TInputOutput | The type of each |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException |
|
| ArgumentNullException |
|
| InvalidOperationException |
|
SortTransform<TInputOutput>(in DownstreamFactory<TInputOutput>, String, Action<IRowComparerCommand<TInputOutput>>)
Initializes a new instance of the SortTransform<TInputOutput> dataflow worker, which sorts the incoming rows by specifying sort columns using a RowComparer<T>, optionally removing duplicates.
The Input port is linked to (if available) the upstream
output or error output port specified by the factory.
Declaration
public static SortTransform<TInputOutput> SortTransform<TInputOutput>(this in DownstreamFactory<TInputOutput> downstreamFactory, string workerName, Action<IRowComparerCommand<TInputOutput>> rowComparerCommandAction)
where TInputOutput : class
Parameters
| Type | Name | Description |
|---|---|---|
| DownstreamFactory<TInputOutput> | downstreamFactory | The downstream factory, which specifies the parent worker and (optionally) the upstream port to link the "first" input port of this dataflow worker to. Get it from Link when the upstream port is known ahead of time (which is usually the case). Otherwise get it from GetDownstreamFactory<TInput>(), and link the transform or target explicitly using LinkTo(InputPort<TOutput>) or LinkFrom(OutputPortBase<TInput>). |
| String | workerName | Name of the worker.
Set to a prefix plus a trailing
While less useful, set to
The name cannot otherwise contain |
| Action<IRowComparerCommand<TInputOutput>> | rowComparerCommandAction | Defines the sort order, such as which columns to sort on, ascending vs. descending etc., e.g.:
Set to Column name matching is ordinal case insensitive, but a case sensitive match takes precedence over a case insensitive match. |
Returns
| Type | Description |
|---|---|
| SortTransform<TInputOutput> | The newly created and (optionally) linked worker. |
Type Parameters
| Name | Description |
|---|---|
| TInputOutput | The type of each |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Could not create comparer. |
| ArgumentException |
|
| ArgumentNullException |
|
| InvalidOperationException |
|
SortTransform<TInputOutput>(in DownstreamFactory<TInputOutput>, String, IComparer<TInputOutput>)
Initializes a new instance of the SortTransform<TInputOutput> dataflow worker, which sorts the incoming rows using the specified IComparer<T>, optionally removing duplicates.
The Input port is linked to (if available) the upstream
output or error output port specified by the factory.
Declaration
public static SortTransform<TInputOutput> SortTransform<TInputOutput>(this in DownstreamFactory<TInputOutput> downstreamFactory, string workerName, IComparer<TInputOutput> rowComparer)
where TInputOutput : class
Parameters
| Type | Name | Description |
|---|---|---|
| DownstreamFactory<TInputOutput> | downstreamFactory | The downstream factory, which specifies the parent worker and (optionally) the upstream port to link the "first" input port of this dataflow worker to. Get it from Link when the upstream port is known ahead of time (which is usually the case). Otherwise get it from GetDownstreamFactory<TInput>(), and link the transform or target explicitly using LinkTo(InputPort<TOutput>) or LinkFrom(OutputPortBase<TInput>). |
| String | workerName | Name of the worker.
Set to a prefix plus a trailing
While less useful, set to
The name cannot otherwise contain |
| IComparer<TInputOutput> | rowComparer | The IComparer<T> that compares two rows.
Set to |
Returns
| Type | Description |
|---|---|
| SortTransform<TInputOutput> | The newly created and (optionally) linked worker. |
Type Parameters
| Name | Description |
|---|---|
| TInputOutput | The type of each |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException |
|
| ArgumentNullException |
|
| InvalidOperationException |
|
SortTransform<TInputOutput>(in DownstreamFactory<TInputOutput>, String, Comparison<TInputOutput>)
Initializes a new instance of the SortTransform<TInputOutput> dataflow worker, which sorts the incoming rows using the specified Comparison<T>, optionally removing duplicates.
The Input port is linked to (if available) the upstream
output or error output port specified by the factory.
Declaration
public static SortTransform<TInputOutput> SortTransform<TInputOutput>(this in DownstreamFactory<TInputOutput> downstreamFactory, string workerName, Comparison<TInputOutput> comparison)
where TInputOutput : class
Parameters
| Type | Name | Description |
|---|---|---|
| DownstreamFactory<TInputOutput> | downstreamFactory | The downstream factory, which specifies the parent worker and (optionally) the upstream port to link the "first" input port of this dataflow worker to. Get it from Link when the upstream port is known ahead of time (which is usually the case). Otherwise get it from GetDownstreamFactory<TInput>(), and link the transform or target explicitly using LinkTo(InputPort<TOutput>) or LinkFrom(OutputPortBase<TInput>). |
| String | workerName | Name of the worker.
Set to a prefix plus a trailing
While less useful, set to
The name cannot otherwise contain |
| Comparison<TInputOutput> | comparison | The function that compares two rows.
Set to |
Returns
| Type | Description |
|---|---|
| SortTransform<TInputOutput> | The newly created and (optionally) linked worker. |
Type Parameters
| Name | Description |
|---|---|
| TInputOutput | The type of each |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException |
|
| ArgumentNullException |
|
| InvalidOperationException |
|