MergeJoin<TInput1, TInput2, TOutput>
Class MergeJoin<TInput1, TInput2, TOutput>
Will join data from the two inputs into one output. Make sure both inputs are sorted or in the right order. Each row from the left join target will be merged with a row from the right join target. If the amount of ingoing data is unevenly distributed, the last rows will be joined with null values.
You can define a match condition that let you only merge matching records. This will change the match behavior a little bit. By assuming that the input is sorted, not matching records will be joined with null then. This can be compared with a left or right join.
Implements
Inherited Members
Namespace: ETLBox.DataFlow
Assembly: ETLBox.dll
Syntax
Type Parameters
Name | Description |
---|---|
TInput1 | Type of ingoing data for the left join target. |
TInput2 | Type of ingoing data for the right join target. |
TOutput | Type of outgoing data. |
Examples
MergeJoin<InputType1, InputType2, OutputType> join = new MergeJoin<InputType1, InputType2, OutputType>();
join.MergeJoinFunc = (leftRow, rightRow) => {
return new OutputType()
{
Result = leftRow.Value 1 + rightRow.Value2
};
});
source1.LinkTo(join.LeftInput);
source2.LinkTo(join.RightInput);
join.LinkTo(dest);
Constructors
MergeJoin()
Declaration
MergeJoin(Func<TInput1, TInput2, TOutput>)
Declaration
Parameters
Type | Name | Description |
---|---|---|
Func<TInput1, TInput2, TOutput> | mergeJoinFunc | Sets the MergeJoinFunc |
MergeJoin(Func<TInput1, TInput2, TOutput>, Func<TInput1, TInput2, int>)
Declaration
Parameters
Type | Name | Description |
---|---|---|
Func<TInput1, TInput2, TOutput> | mergeJoinFunc | Sets the MergeJoinFunc |
Func<TInput1, TInput2, int> | comparisonFunc | Sets the ComparisonFunc |
Properties
Buffer
Declaration
Property Value
Type | Description |
---|---|
BufferBlock<TOutput> |
ComparisonFunc
If the ComparisonFunc is defined, records are compared regarding their sort order and only joined if they match. Return 0 if both records match and should be joined. Return a value little than 0 if the record of the left input is in the sort order before the record of the right input. Return a value greater than 0 if the record for the right input is in the order before the record from the left input.
Declaration
Property Value
Type | Description |
---|---|
Func<TInput1, TInput2, int> |
Remarks
Make sure that both inputs are sorted, and the comparison func take the sort order into account.
LeftInput
The left target of the merge join. Use this to link your source component with.
Declaration
Property Value
Type | Description |
---|---|
JoinTarget<TInput1> |
MergeJoinFunc
The func that describes how both records from the left and right join target can be joined.
Declaration
Property Value
Type | Description |
---|---|
Func<TInput1, TInput2, TOutput> |
RightInput
The right target of the merge join. Use this to link your source component with.
Declaration
Property Value
Type | Description |
---|---|
JoinTarget<TInput2> |
SourceBlock
SourceBlock from the underlying TPL.Dataflow which is used as output buffer for the component.
Declaration
Property Value
Type | Description |
---|---|
ISourceBlock<TOutput> |
Overrides
Methods
CheckParameter()
Declaration
Overrides
CleanUpOnFaulted(Exception)
Declaration
Parameters
Type | Name | Description |
---|---|---|
Exception | e |