Search Results for

    Show / Hide Table of Contents

    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.

    Inheritance
    Object
    SortTransformFactory
    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 "/" (e.g. "MyPrefix-/") to generate a unique name from the prefix plus an increasing number starting at 1.

    While less useful, set to null, whitespace or "/" to generate a unique name from the worker type plus an increasing number starting at 1.

    The name cannot otherwise contain "/", and cannot start with double underscore "__".

    Returns
    Type Description
    SortTransform<TInputOutput>

    The newly created and (optionally) linked worker.

    Type Parameters
    Name Description
    TInputOutput

    The type of each Input and Output row.

    Exceptions
    Type Condition
    ArgumentException

    workerName:

    • Workers with the same parent must have unique names.
    • Worker and worker system names cannot contain '/' or start with double underscore '__'.
    ArgumentNullException

    workerParent - All workers must have a parent. The top level workers have the worker system as parent.

    InvalidOperationException
    • Cannot add child worker to parent which has completed. Are you adding it to the correct parent?
    • Cannot add worker to parent, since its children have been started. Are you adding it to the correct parent?

    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 "/" (e.g. "MyPrefix-/") to generate a unique name from the prefix plus an increasing number starting at 1.

    While less useful, set to null, whitespace or "/" to generate a unique name from the worker type plus an increasing number starting at 1.

    The name cannot otherwise contain "/", and cannot start with double underscore "__".

    Action<IRowComparerCommand<TInputOutput>> rowComparerCommandAction

    Defines the sort order, such as which columns to sort on, ascending vs. descending etc., e.g.:

    cb => cb.Asc("Name").Desc("Price")

    Set to null to use the default comparison (requires that TInputOutput implements IComparable<T> or IComparable). Also see Compare Dataflow Columns.

    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 Input and Output row.

    Exceptions
    Type Condition
    InvalidOperationException

    Could not create comparer.

    ArgumentException

    workerName:

    • Workers with the same parent must have unique names.
    • Worker and worker system names cannot contain '/' or start with double underscore '__'.
    ArgumentNullException

    workerParent - All workers must have a parent. The top level workers have the worker system as parent.

    InvalidOperationException
    • Cannot add child worker to parent which has completed. Are you adding it to the correct parent?
    • Cannot add worker to parent, since its children have been started. Are you adding it to the correct parent?

    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 "/" (e.g. "MyPrefix-/") to generate a unique name from the prefix plus an increasing number starting at 1.

    While less useful, set to null, whitespace or "/" to generate a unique name from the worker type plus an increasing number starting at 1.

    The name cannot otherwise contain "/", and cannot start with double underscore "__".

    IComparer<TInputOutput> rowComparer

    The IComparer<T> that compares two rows. Set to null to use the default comparison (which requires that TInputOutput implements IComparable<T> or IComparable).

    Returns
    Type Description
    SortTransform<TInputOutput>

    The newly created and (optionally) linked worker.

    Type Parameters
    Name Description
    TInputOutput

    The type of each Input and Output row.

    Exceptions
    Type Condition
    ArgumentException

    workerName:

    • Workers with the same parent must have unique names.
    • Worker and worker system names cannot contain '/' or start with double underscore '__'.
    ArgumentNullException

    workerParent - All workers must have a parent. The top level workers have the worker system as parent.

    InvalidOperationException
    • Cannot add child worker to parent which has completed. Are you adding it to the correct parent?
    • Cannot add worker to parent, since its children have been started. Are you adding it to the correct parent?

    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 "/" (e.g. "MyPrefix-/") to generate a unique name from the prefix plus an increasing number starting at 1.

    While less useful, set to null, whitespace or "/" to generate a unique name from the worker type plus an increasing number starting at 1.

    The name cannot otherwise contain "/", and cannot start with double underscore "__".

    Comparison<TInputOutput> comparison

    The function that compares two rows. Set to null to use the default comparison (which requires that TInputOutput implements IComparable<T> or IComparable).

    Returns
    Type Description
    SortTransform<TInputOutput>

    The newly created and (optionally) linked worker.

    Type Parameters
    Name Description
    TInputOutput

    The type of each Input and Output row.

    Exceptions
    Type Condition
    ArgumentException

    workerName:

    • Workers with the same parent must have unique names.
    • Worker and worker system names cannot contain '/' or start with double underscore '__'.
    ArgumentNullException

    workerParent - All workers must have a parent. The top level workers have the worker system as parent.

    InvalidOperationException
    • Cannot add child worker to parent which has completed. Are you adding it to the correct parent?
    • Cannot add worker to parent, since its children have been started. Are you adding it to the correct parent?

    See Also

    SortTransform<TInputOutput>
    In This Article
    Back to top Copyright © 2023 Envobi Ltd