Class JoinMergeSortedTransformBase<TDerived, TLeftInput, TRightInput, TOutput>
An abstract dataflow worker with two input ports and one Output
port, that performs a
merge-join on the two presorted inputs (except for a cross join which does not
require sorted inputs).The row order on the inputs must match the ordering specified to the
constructor.
Note that both inputs must be presorted according to the order specified by the comparison
function (provided by the rowComparerCommandAction
parameter or the Comparison
property),
including collation order for textual columns, where in the order any null
s appear and
if null
s are equal to each other or not.
Non-cross-joins are
partially blocking
on the RightInput
input port:
when a join is found, it will buffer all rows from the RightInput
port that compare equal
to the join rows. This consumes "Number of RightInput rows comparing equal" multiplied by
"Memory per RightInput row". To conserve memory, link RightInput
to the upstream
output with the expected smallest memory consumption.
Cross-joins are instead fully blocking on the RightInput
input port,
and will buffer all rows from the RightInput
port.
Note that this base class is not used directly by library users. Instead use CrossJoinTransformFactory, FullJoinMergeSortedTransformFactory, InnerJoinMergeSortedTransformFactory, LeftJoinMergeSortedTransformFactory, or RightJoinMergeSortedTransformFactory.
Inheritance
Implements
Inherited Members
Namespace: actionETL
Assembly: actionETL.dll
Syntax
public abstract class JoinMergeSortedTransformBase<TDerived, TLeftInput, TRightInput, TOutput> : WorkerBase<TDerived>, IDisposeOnFinished where TDerived : JoinMergeSortedTransformBase<TDerived, TLeftInput, TRightInput, TOutput> where TLeftInput : class where TRightInput : class where TOutput : class, new()
Type Parameters
Name | Description |
---|---|
TDerived | The type of the derived worker. |
TLeftInput | The type of each |
TRightInput | The type of each |
TOutput | The type of each |
Properties
Comparison
Gets or sets the comparison function that compares left and right input rows. Cannot be set after the worker has started running. Cannot be set at all for the cross-join transform.
For non-cross-join transforms: can be null
, although either
rowComparerCommandAction
must be provided to the constructor,
or the Comparison
property must be set.
The function must evaluate to
-1
if TLeftInput
is smaller than TRightInput
,
0
if they are equal, and 1
if TLeftInput
is bigger than TRightInput
.
Note: This property is thread-safe.
///Declaration
public Comparison<TLeftInput, TRightInput> Comparison { get; set; }
Property Value
Type | Description |
---|---|
Comparison<TLeftInput, TRightInput> | The comparison function callback. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Cannot set the value after the worker has started running. |
LeftInput
Gets the left input port for consuming rows from the left upstream worker.
Declaration
public InputPort<TLeftInput> LeftInput { get; }
Property Value
Type | Description |
---|---|
InputPort<TLeftInput> | The left input port. |
Output
Gets the output port for sending rows to the downstream worker.
Declaration
public OutputPort<TOutput> Output { get; }
Property Value
Type | Description |
---|---|
OutputPort<TOutput> | The output port. |
RightInput
Gets the right input port for consuming rows from the right upstream worker.
Declaration
public InputPort<TRightInput> RightInput { get; }
Property Value
Type | Description |
---|---|
InputPort<TRightInput> | The right input port. |
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, these classes are used without overriding this method.
Declaration
protected override async Task<OutcomeStatus> RunAsync()
Returns
Type | Description |
---|---|
Task<OutcomeStatus> | A |
Overrides
Exceptions
Type | Condition |
---|---|
InvalidOperationException |