LookupTransformation<TInput, TSource>
Class LookupTransformation<TInput, TSource>
The lookup transformation enriches the incoming data with data from the lookup source. Data from the lookup source is read into memory when the first record arrives. For each incoming row, the lookup tries to find a matching record in the loaded source data and uses this record to enrich the ingoing data.
Inheritance
Implements
Inherited Members
Namespace: ETLBox.DataFlow
Assembly: ETLBox.dll
Syntax
Type Parameters
Name | Description |
---|---|
TInput | Type of ingoing and outgoing data. |
TSource | Type of data used in the lookup source. |
Constructors
LookupTransformation()
Declaration
LookupTransformation(IDataFlowExecutableSource<TSource>)
Declaration
Parameters
Type | Name | Description |
---|---|---|
IDataFlowExecutableSource<TSource> | source | Sets the Source of the lookup. |
LookupTransformation(IDataFlowExecutableSource<TSource>, Func<TInput, CachedData<TSource>, TInput>)
Declaration
Parameters
Type | Name | Description |
---|---|---|
IDataFlowExecutableSource<TSource> | source | Sets the Source of the lookup. |
Func<TInput, CachedData<TSource>, TInput> | applyRetrievedCacheToInput | Sets the ApplyRetrievedCacheToInput function. |
Properties
ApplyRetrievedCacheForMultipleOutputs
This function describes how the ingoing data can be enriched with the already pre-read data from the Source, but can return multiple rows for every input row. This is necessary if PermitMultipleEntriesPerKey is set to true, which allows the cache lookup to load multiple rows for every key.
Declaration
Property Value
Type | Description |
---|---|
Func<TInput, CachedData<TSource>, TInput[]> |
ApplyRetrievedCacheToInput
This function describes how the ingoing data can be enriched with the already pre-read data from the Source.
Declaration
Property Value
Type | Description |
---|---|
Func<TInput, CachedData<TSource>, TInput> |
CacheMode
The cache mode used for loading data into the lookup cache. By default, all data is loaded into memory from the lookup source when the first records arrives at the lookup.
Declaration
Property Value
Type | Description |
---|---|
CacheMode |
CachedBatchTransformation
Declaration
Property Value
Type | Description |
---|---|
CachedBatchTransformation<TInput, TInput, TSource> |
InputKeySelector
This function describe how the key is generated for an ingoing row. If the result of this function match with SourceKeySelector, both records can be identified as a match.
Declaration
Property Value
Type | Description |
---|---|
Func<TInput, object> |
MatchColumns
This collection will be used to define the matching columns - will also work with ExpandoObject.
Declaration
Property Value
Type | Description |
---|---|
ICollection<MatchColumn> |
OnNoMatchFound
Specifies the function to be invoked when a lookup operation fails to find a matching key in the source. Will only be invoked if ApplyRetrievedCacheToInput or ApplyRetrievedCacheForMultipleOutputs is not set! This action contains the current input row and the lookup key for which no match was found.
Declaration
Property Value
Type | Description |
---|---|
Action<TInput, object> |
PartialCacheSettings
Only need if you set the CacheMode to PartialDbCache. This will only work if you use a DbSource as lookup source.
Declaration
Property Value
Type | Description |
---|---|
LookupTransformation<TInput, TSource>.PartialDbCacheSettings |
PermitMultipleEntriesPerKey
If set to true, multiple entries can be loaded into the cache for every key. Otherwise, only the first occurence will be loaded into the cache.
Declaration
Property Value
Type | Description |
---|---|
bool |
ProgressCount
Declaration
Property Value
Type | Description |
---|---|
int |
RetrieveColumns
This collection will be used to define the retrieve columns - will also work with ExpandoObject.
Declaration
Property Value
Type | Description |
---|---|
ICollection<RetrieveColumn> |
ShouldSkipRow
Specifies if a row should be skipped based on the input row. If this function returns true, the row will be skipped and not be processed by the lookup. Will only be invoked if ApplyRetrievedCacheToInput or ApplyRetrievedCacheForMultipleOutputs is not set!
Declaration
Property Value
Type | Description |
---|---|
Predicate<TInput> |
Source
The source component from which the lookup data is retrieved. E.g. a DbSource or a MemorySource.
Declaration
Property Value
Type | Description |
---|---|
IDataFlowExecutableSource<TSource> |
SourceBlock
SourceBlock from the underlying TPL.Dataflow which is used as output buffer for the component.
Declaration
Property Value
Type | Description |
---|---|
ISourceBlock<TInput> |
Overrides
SourceKeySelector
This function describe how the key is generated for a row from the lookup source. This key is used to store the data in the lookup dictionary.
Declaration
Property Value
Type | Description |
---|---|
Func<TSource, object> |
TargetBlock
TargetBlock from the underlying TPL.Dataflow which is used as input buffer for the component.
Declaration
Property Value
Type | Description |
---|---|
ITargetBlock<TInput> |
Overrides
UseExactNumericTypes
If set to true, data types are ignored when comparing data to identify matching records. E.g. property that stores the integer value 7 would match with a string "7".
Declaration
Property Value
Type | Description |
---|---|
bool |
Methods
CheckParameter()
Declaration
Overrides
CleanUpOnFaulted(Exception)
Declaration
Parameters
Type | Name | Description |
---|---|---|
Exception | e |
Overrides
CleanUpOnSuccess()
Declaration
Overrides
InitComponent()
Declaration
Overrides
LinkErrorTo(IDataFlowDestination<ETLBoxError>)
If an error occurs in the component, by default the component will throw an exception and stop execution. If you use the error linking, any erroneous records will be caught and redirected.
Declaration
Parameters
Type | Name | Description |
---|---|---|
IDataFlowDestination<ETLBoxError> | target | The target for erroneous rows. |
Returns
Type | Description |
---|---|
IDataFlowSource<ETLBoxError> | The linked component. |