Search Results for

    Show / Hide Table of Contents

    Class CrossJoinTransformFactory

    Factory methods that create a CrossJoinTransform<TLeftInput, TRightInput, TOutput> dataflow worker, with two input ports and one Output port, that performs a Cross Join on the two inputs.

    This worker is fully blocking on the RightInput input port, and will buffer all its rows. Therefore, to conserve memory, link RightInput to the upstream output where the rows will consume the least amount of memory (i.e. the smallest numberOfRows * memoryPerRow).

    The "first" LeftInput 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>).

    Inheritance
    Object
    CrossJoinTransformFactory
    Namespace: actionETL
    Assembly: actionETL.dll
    Syntax
    public static class CrossJoinTransformFactory

    Methods

    CrossJoinTransform<TLeftInput, TRightInput, TOutput>(in DownstreamFactory<TLeftInput>, String, OutputPortBase<TRightInput>, Action<IRowMapperCommand>, Action<IRowMapperCommand>)

    Initializes a new instance of the CrossJoinTransform<TLeftInput, TRightInput, TOutput> dataflow worker, with two input ports and one Output port, that performs a Cross Join on the two inputs.

    The output rows are created by specifying which columns (or whole row) to copy to the output, using IRowMapperCommand. Also see Dataflow Column Mapping.

    The "first" LeftInput port is linked to (if available) the upstream output or error output port specified by the factory.

    Declaration
    public static CrossJoinTransform<TLeftInput, TRightInput, TOutput> CrossJoinTransform<TLeftInput, TRightInput, TOutput>(this in DownstreamFactory<TLeftInput> downstreamFactory, string workerName, OutputPortBase<TRightInput> rightInputFrom, Action<IRowMapperCommand> leftRowMapperCommandAction, Action<IRowMapperCommand> rightRowMapperCommandAction)
        where TLeftInput : class where TRightInput : class where TOutput : class, new()
    Parameters
    Type Name Description
    DownstreamFactory<TLeftInput> downstreamFactory

    The downstream factory, which specifies the parent worker and (optionally) the upstream port to link the "first" LeftInput 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 "__".

    OutputPortBase<TRightInput> rightInputFrom

    Output port on upstream worker to link to this worker's RightInput port.

    Action<IRowMapperCommand> leftRowMapperCommandAction

    Defines which columns (or whole row) to copy from the left input rows to the output rows, e.g.:

    clb => clb.Name("ProductId").Name("ProductName")

    Note: All mapped columns must have a data type that supports multi-copy.

    Can be null, although either one or both of leftRowMapperCommandAction and rightRowMapperCommandAction must be set.

    Column name matching is ordinal case insensitive, but a case sensitive match takes precedence over a case insensitive match.

    Action<IRowMapperCommand> rightRowMapperCommandAction

    Defines which columns (or whole row) to copy from the right input rows to the output rows, e.g.:

    crb => crb.Name("ProductWeight").Name("ProductPrice")

    Note: All mapped columns must have a data type that supports multi-copy.

    Can be null, although either one or both of leftRowMapperCommandAction and rightRowMapperCommandAction must be set.

    Column name matching is ordinal case insensitive, but a case sensitive match takes precedence over a case insensitive match.

    Returns
    Type Description
    CrossJoinTransform<TLeftInput, TRightInput, TOutput>

    The newly created and (optionally) linked worker.

    Type Parameters
    Name Description
    TLeftInput

    The type of each LeftInput row.

    TRightInput

    The type of each RightInput row.

    TOutput

    The type of each 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?

    CrossJoinTransform<TLeftInput, TRightInput, TOutput>(in DownstreamFactory<TLeftInput>, String, OutputPortBase<TRightInput>, Func<TLeftInput, TRightInput, TOutput>)

    Initializes a new instance of the CrossJoinTransform<TLeftInput, TRightInput, TOutput> dataflow worker, with two input ports and one Output port, that performs a Cross Join on the two inputs.

    A callback function creates the output row.

    The "first" LeftInput port is linked to (if available) the upstream output or error output port specified by the factory.

    Declaration
    public static CrossJoinTransform<TLeftInput, TRightInput, TOutput> CrossJoinTransform<TLeftInput, TRightInput, TOutput>(this in DownstreamFactory<TLeftInput> downstreamFactory, string workerName, OutputPortBase<TRightInput> rightInputFrom, Func<TLeftInput, TRightInput, TOutput> outputFunc)
        where TLeftInput : class where TRightInput : class where TOutput : class, new()
    Parameters
    Type Name Description
    DownstreamFactory<TLeftInput> downstreamFactory

    The downstream factory, which specifies the parent worker and (optionally) the upstream port to link the "first" LeftInput 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 "__".

    OutputPortBase<TRightInput> rightInputFrom

    Output port on upstream worker to link to this worker's RightInput port.

    Func<TLeftInput, TRightInput, TOutput> outputFunc

    A function that, given left and right input rows, must return the joined row to output, or null to not output a row. The function can either create the output row by allocating a new row and setting its columns, or by returning one of the input rows, after optionally modifying some of its columns.

    Do ensure the function adheres to the Row Ownership rules. Note that since a single input row can join to multiple rows on the other input, any column values copied to the output must be deep copied, unless they are pure value types or immutable.

    Returns
    Type Description
    CrossJoinTransform<TLeftInput, TRightInput, TOutput>

    The newly created and (optionally) linked worker.

    Type Parameters
    Name Description
    TLeftInput

    The type of each LeftInput row.

    TRightInput

    The type of each RightInput row.

    TOutput

    The type of each 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

    CrossJoinTransform<TLeftInput, TRightInput, TOutput>
    JoinMergeSortedTransformBase<TDerived, TLeftInput, TRightInput, TOutput>
    Dataflow Columns
    In This Article
    Back to top Copyright © 2023 Envobi Ltd