CrossJoin<TInput1, TInput2, TOutput>
Class CrossJoin<TInput1, TInput2, TOutput>
The CrossJoin allows you to combine every record from one input with every record from the other input. The input for the first table will be loaded into memory before join starts. Then every incoming row will be joined with every row of the InMemory-Table using the CrossJoinFunc function. The InMemory target should always be the target of the smaller amount of data to reduce memory consumption and processing time.
Implements
Inherited Members
Namespace: ETLBox.DataFlow
Assembly: ETLBox.dll
Syntax
public class CrossJoin<TInput1, TInput2, TOutput> : DataFlowSource<TOutput>, IDataFlowSource<TOutput>, IDataFlowSource, IDataFlowDestination, IDataFlowComponent, ILoggableTaskType Parameters
| Name | Description |
|---|---|
| TInput1 | Type of data for in memory input block. |
| TInput2 | Type of data for processing input block. |
| TOutput | Type of output data. |
Examples
CrossJoin<InputType1, InputType2, OutputType> crossJoin = new CrossJoin<InputType1, InputType2, OutputType>();
crossJoin.CrossJoinFunc = (inmemoryRow, passingRow) => {
return new OutputType() {
Result = leftRow.Value1 + rightRow.Value2
};
});
source1.LinkTo(join.InMemoryTarget);
source2.LinkTo(join.PassingTarget);
join.LinkTo(dest);Constructors
CrossJoin()
Declaration
public CrossJoin()CrossJoin(Func<TInput1, TInput2, TOutput>)
Declaration
public CrossJoin(Func<TInput1, TInput2, TOutput> crossJoinFunc)Parameters
| Type | Name | Description |
|---|---|---|
| Func<TInput1, TInput2, TOutput> | crossJoinFunc | Sets the CrossJoinFunc |
Properties
Buffer
Declaration
protected BufferBlock<TOutput> Buffer { get; set; }Property Value
| Type | Description |
|---|---|
| BufferBlock<TOutput> |
CrossJoinFunc
The cross join function that describes how records from the both target can be joined.
Declaration
public Func<TInput1, TInput2, TOutput> CrossJoinFunc { get; set; }Property Value
| Type | Description |
|---|---|
| Func<TInput1, TInput2, TOutput> |
InMemoryTarget
The in-memory target of the CrossJoin. This will block processing until all data is received that is designated for this target. Always have the smaller amount of data flown into this target.
Declaration
public CrossJoin<TInput1, TInput2, TOutput>.InMemoryDestination<TInput1> InMemoryTarget { get; set; }Property Value
| Type | Description |
|---|---|
| CrossJoin<TInput1, TInput2, TOutput>.InMemoryDestination<TInput1> |
PassingTarget
Every row that the PassingTarget receives is joined with all data from the ETLBox.DataFlow.CrossJoin<TInput1, TInput2, TOutput>.InMemoryData.
Declaration
public JoinTarget<TInput2> PassingTarget { get; set; }Property Value
| Type | Description |
|---|---|
| JoinTarget<TInput2> |
SourceBlock
SourceBlock from the underlying TPL.Dataflow which is used as output buffer for the component.
Declaration
public override ISourceBlock<TOutput> SourceBlock { get; }Property Value
| Type | Description |
|---|---|
| ISourceBlock<TOutput> |
Overrides
Methods
CheckParameter()
Declaration
protected override void CheckParameter()Overrides
CleanUpOnFaulted(Exception)
Declaration
protected override void CleanUpOnFaulted(Exception e)Parameters
| Type | Name | Description |
|---|---|---|
| Exception | e |
Overrides
CleanUpOnSuccess()
Declaration
protected override void CleanUpOnSuccess()Overrides
InitComponent()
Declaration
protected override void InitComponent()Overrides
Reset()
Declaration
protected override void Reset()