• Getting started
  • API Documentation
  • Pricing
  • Contact
Show / Hide Table of Contents
  • ETLBox.Connection
    • AccessOdbcConnectionManager
    • AdomdConnectionManager
    • ConnectionManagerType
    • Db2ConnectionManager
    • Db2ConnectionString
    • DbConnectionManager<Connection>
    • DbConnectionString<T, TBuilder>
    • IConnectionManager
    • IDbConnectionString
    • MariaDbConnectionManager
    • MariaDbConnectionString
    • MySqlConnectionManager
    • MySqlConnectionString
    • MySqlOdbcConnectionManager
    • OdbcConnectionManager
    • OdbcConnectionString
    • OleDbConnectionManager
    • OleDbConnectionString
    • OracleConnectionManager
    • OracleConnectionString
    • OracleOdbcConnectionManager
    • PostgresConnectionManager
    • PostgresConnectionString
    • PostgresOdbcConnectionManager
    • SqlConnectionManager
    • SqlConnectionString
    • SQLiteConnectionManager
    • SQLiteConnectionString
    • SqlOdbcConnectionManager
    • SqlOleDbConnectionManager
  • ETLBox.ControlFlow
    • ControlFlow
    • ControlFlowTask
    • DbTask
    • DropTask<T>
    • IfExistsTask
    • ILoggableTask
    • ITableData
    • LoggableTask
    • ProcedureDefinition
    • ProcedureParameter
    • QueryParameter
    • TableColumn
    • TableData
    • TableData<T>
    • TableDefinition
  • ETLBox.ControlFlow.Tasks
    • CalculateDatabaseHashTask
    • CleanUpSchemaTask
    • CreateDatabaseTask
    • CreateIndexTask
    • CreateProcedureTask
    • CreateSchemaTask
    • CreateTableTask
    • CreateViewTask
    • DropDatabaseTask
    • DropIndexTask
    • DropProcedureTask
    • DropSchemaTask
    • DropTableTask
    • DropViewTask
    • GetDatabaseListTask
    • IfDatabaseExistsTask
    • IfIndexExistsTask
    • IfProcedureExistsTask
    • IfSchemaExistsTask
    • IfTableOrViewExistsTask
    • RecoveryModel
    • RowCountOptions
    • RowCountTask
    • SqlTask
    • TruncateTableTask
    • XmlaTask
  • ETLBox.DataFlow
    • AggregateColumn
    • ChangeAction
    • ColumnMap
    • CompareColumn
    • DataFlow
    • DataFlowBatchDestination<TInput>
    • DataFlowComponent
    • DataFlowDestination<TInput>
    • DataFlowExecutableSource<TOutput>
    • DataFlowJoinTarget<TInput>
    • DataFlowSource<TOutput>
    • DataFlowStreamDestination<TInput>
    • DataFlowStreamSource<TOutput>
    • DataFlowTransformation<TInput, TOutput>
    • DeleteColumn
    • DistinctColumn
    • ErrorSource
    • ETLBoxError
    • ExcelColumn
    • ExcelRange
    • GroupColumn
    • ICacheManager<TInput, TCache>
    • IDataFlowBatchDestination
    • IDataFlowBatchDestination<TInput>
    • IDataFlowComponent
    • IDataFlowDestination
    • IDataFlowDestination<TInput>
    • IDataFlowExecutableSource
    • IDataFlowExecutableSource<TOutput>
    • IDataFlowLogging
    • IDataFlowSource
    • IDataFlowSource<TOutput>
    • IDataFlowStreamDestination
    • IDataFlowStreamDestination<TInput>
    • IDataFlowStreamSource
    • IDataFlowStreamSource<TOutput>
    • IDataFlowTransformation<TInput, TOutput>
    • IDataFlowTransformation<TOutput>
    • IdColumn
    • IMergeableRow
    • JoinTarget<TInput>
    • MatchColumn
    • MemoryCache<TInput, TCache>
    • MergeableRow
    • MergeMode
    • MergeProperties
    • Network
    • ResourceType
    • RetrieveColumn
    • StreamMetaData
    • TypeInfo
    • UpdateColumn
  • ETLBox.DataFlow.Connectors
    • ConcurrentMemoryDestination
    • ConcurrentMemoryDestination<TInput>
    • CsvDestination
    • CsvDestination<TInput>
    • CsvSource
    • CsvSource<TOutput>
    • CustomBatchDestination
    • CustomBatchDestination<TInput>
    • CustomBatchSource
    • CustomBatchSource<TOutput>
    • CustomDestination
    • CustomDestination<TInput>
    • CustomSource
    • CustomSource<TOutput>
    • DbDestination
    • DbDestination<TInput>
    • DbMerge
    • DbMerge<TInput>
    • DbSource
    • DbSource<TOutput>
    • ExcelSource
    • ExcelSource<TOutput>
    • JsonDestination
    • JsonDestination<TInput>
    • JsonSource
    • JsonSource<TOutput>
    • MemoryDestination
    • MemoryDestination<TInput>
    • MemorySource
    • MemorySource<TOutput>
    • TextDestination
    • TextDestination<TInput>
    • TextSource
    • TextSource<TOutput>
    • VoidDestination
    • VoidDestination<TInput>
    • XmlDestination
    • XmlDestination<TInput>
    • XmlSource
    • XmlSource<TOutput>
  • ETLBox.DataFlow.Transformations
    • Aggregation
    • Aggregation<TInput, TOutput>
    • AggregationMethod
    • BatchTransformation
    • BatchTransformation<TInput, TOutput>
    • BatchTransformation<TInput>
    • BlockTransformation
    • BlockTransformation<TInput, TOutput>
    • BlockTransformation<TInput>
    • CachedBatchTransformation
    • CachedBatchTransformation<TInput, TOutput, TCache>
    • CachedBatchTransformation<TInput, TOutput>
    • CachedBatchTransformation<TInput>
    • CachedRowTransformation
    • CachedRowTransformation<TInput, TOutput, TCache>
    • CachedRowTransformation<TInput, TOutput>
    • CachedRowTransformation<TInput>
    • CacheMode
    • ColumnRename
    • ColumnRename<TInput>
    • CrossJoin
    • CrossJoin<TInput>
    • CrossJoin<TInput1, TInput2, TOutput>
    • CrossJoin<TInput1, TInput2, TOutput>.InMemoryDestination<TInput>
    • Distinct<TInput>
    • LookupTransformation
    • LookupTransformation<TInput, TSource>
    • LookupTransformation<TInput, TSource>.PartialDbCacheSettings
    • MergeJoin
    • MergeJoin<TInput>
    • MergeJoin<TInput1, TInput2, TOutput>
    • Multicast
    • Multicast<TInput>
    • RowDuplication
    • RowDuplication<TInput>
    • RowMultiplication
    • RowMultiplication<TInput, TOutput>
    • RowMultiplication<TInput>
    • RowTransformation
    • RowTransformation<TInput, TOutput>
    • RowTransformation<TInput>
    • Sort
    • Sort<TInput>
    • XmlSchemaValidation
    • XmlSchemaValidation<TInput>
  • ETLBox.Exceptions
    • ETLBoxException
    • ETLBoxFaultedBufferException
    • ETLBoxNotSupportedException
  • ETLBox.Helper
    • BatchLinq
    • BulkSqlGenerator<T>
    • DataTypeConverter
    • ExpandoJsonPathConverter
    • HashHelper
    • IDataTypeConverter
    • JsonPathConverter
    • JsonProperty2JsonPath
    • JsonProperty2JsonPath.MultipleResultsInPath
    • ObjectNameDescriptor
    • PropertyInfoExtension
    • SqlParser
    • StringExtension
  • ETLBox.Logging
    • AbortLoadProcessTask
    • CreateErrorTableTask
    • CreateLoadProcessTableTask
    • CreateLogTableTask
    • CustomTask
    • EndLoadProcessTask
    • ETLLogLayoutRenderer
    • GetLoadProcessAsJSONTask
    • GetLogAsJSONTask
    • LoadProcess
    • LogEntry
    • Logging
    • LogHierarchyEntry
    • LogTask
    • Package
    • ReadLoadProcessTableTask
    • ReadLogTableTask
    • ReadOptions
    • Sequence
    • Sequence<T>
    • StartLoadProcessTask

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
System.Object
LoggableTask
DataFlowComponent
DataFlowSource<TInput>
DataFlowTransformation<TInput, TInput>
LookupTransformation<TInput, TSource>
LookupTransformation
Implements
ILoggableTask
IDataFlowLogging
IDataFlowTransformation<TInput, TInput>
IDataFlowSource<TInput>
IDataFlowSource
IDataFlowDestination<TInput>
IDataFlowDestination
IDataFlowComponent
Inherited Members
DataFlowTransformation<TInput, TInput>.TargetBlock
DataFlowSource<TInput>.LinkTo(IDataFlowDestination<TInput>)
DataFlowSource<TInput>.LinkTo(IDataFlowDestination<TInput>, Predicate<TInput>)
DataFlowSource<TInput>.LinkTo(IDataFlowDestination<TInput>, Predicate<TInput>, Predicate<TInput>)
DataFlowSource<TInput>.LinkTo<TConvert>(IDataFlowDestination<TInput>)
DataFlowSource<TInput>.LinkTo<TConvert>(IDataFlowDestination<TInput>, Predicate<TInput>)
DataFlowSource<TInput>.LinkTo<TConvert>(IDataFlowDestination<TInput>, Predicate<TInput>, Predicate<TInput>)
DataFlowComponent.MaxBufferSize
DataFlowComponent._maxBufferSize
DataFlowComponent.Predecessors
DataFlowComponent.Successors
DataFlowComponent.Completion
DataFlowComponent.WasComponentInitialized
DataFlowComponent.ReadyForProcessing
DataFlowComponent.WasLinked
DataFlowComponent.SetParent(DataFlowComponent)
DataFlowComponent.InternalLinkTo<T>(IDataFlowDestination, Object, Object)
DataFlowComponent.LinkBuffersRecursively()
DataFlowComponent.InitBufferObjects()
DataFlowComponent.SetCompletionTask()
DataFlowComponent.RunErrorSourceInit()
DataFlowComponent.OnCompletion
DataFlowComponent.CompleteOrFaultBufferOnPredecessorCompletion(Task)
DataFlowComponent.Exception
DataFlowComponent.ErrorSource
DataFlowComponent.HandleCanceledOrFaultedBuffer()
DataFlowComponent.InternalLinkErrorTo(IDataFlowDestination<ETLBoxError>)
DataFlowComponent.ThrowOrRedirectError(Exception, String)
DataFlowComponent.ThrowError(Exception, String)
DataFlowComponent._loggingThresholdRows
DataFlowComponent.LoggingThresholdRows
DataFlowComponent.HasLoggingThresholdRows
DataFlowComponent.ThresholdCount
DataFlowComponent.WasLoggingStarted
DataFlowComponent.WasLoggingFinished
DataFlowComponent.NLogStartOnce()
DataFlowComponent.NLogFinishOnce()
DataFlowComponent.LogProgressBatch_AfterThrowOrRedirectError(Int32)
DataFlowComponent.LogProgress_AfterThrowOrRedirectError(Boolean)
LoggableTask.TaskType
LoggableTask._disableLogging
LoggableTask.DisableLogging
LoggableTask.TaskHash
LoggableTask.CopyLogTaskProperties(ILoggableTask)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: ETLBox.DataFlow.Transformations
Assembly: ETLBox.dll
Syntax
public class LookupTransformation<TInput, TSource> : DataFlowTransformation<TInput, TInput>, ILoggableTask, IDataFlowLogging, IDataFlowTransformation<TInput, TInput>, IDataFlowSource<TInput>, IDataFlowSource, IDataFlowDestination<TInput>, IDataFlowDestination, IDataFlowComponent
Type Parameters
Name Description
TInput

Type of ingoing and outgoing data.

TSource

Type of data used in the lookup source.

Examples
public class Order
{    
    public int OrderNumber { get; set; }
    public int CustomerId { get; set; }
    public string CustomerName { get; set; }
}

public class Customer
{
    [RetrieveColumn(nameof(Order.CustomerId))]
    public int Id { get; set; }

    [MatchColumn(nameof(Order.CustomerName))]
    public string Name { get; set; }
}

DbSource<Order> orderSource = new DbSource<Order>("OrderData");
CsvSource<Customer> lookupSource = new CsvSource<Customer>("CustomerData.csv");
var lookup = new LookupTransformation<Order, Customer>();
lookup.Source = lookupSource;
DbDestination<Order> dest = new DbDestination<Order>("OrderWithCustomerTable");
source.LinkTo(lookup).LinkTo(dest);

Constructors

LookupTransformation()

Declaration
public LookupTransformation()

LookupTransformation(IDataFlowExecutableSource<TSource>)

Declaration
public LookupTransformation(IDataFlowExecutableSource<TSource> source)
Parameters
Type Name Description
IDataFlowExecutableSource<TSource> source

Sets the Source of the lookup.

LookupTransformation(IDataFlowExecutableSource<TSource>, Func<TInput, ICollection<TSource>, TInput>)

Declaration
public LookupTransformation(IDataFlowExecutableSource<TSource> source, Func<TInput, ICollection<TSource>, TInput> retrievalFunc)
Parameters
Type Name Description
IDataFlowExecutableSource<TSource> source

Sets the Source of the lookup.

System.Func<TInput, System.Collections.Generic.ICollection<TSource>, TInput> retrievalFunc

Sets the RetrievalFunc

Properties

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
public CacheMode CacheMode { get; set; }
Property Value
Type Description
CacheMode

GetInputRecordKeyFunc

This function describe how the key is generated for an ingoing row. If the result of this function match with GetSourceRecordKeyFunc, both records can be identified as a match.

Declaration
public Func<TInput, object> GetInputRecordKeyFunc { get; set; }
Property Value
Type Description
System.Func<TInput, System.Object>

GetSourceRecordKeyFunc

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
public Func<TSource, object> GetSourceRecordKeyFunc { get; set; }
Property Value
Type Description
System.Func<TSource, System.Object>

IgnoreDataTypes

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
public bool IgnoreDataTypes { get; set; }
Property Value
Type Description
System.Boolean

MatchColumns

This collection will be used to define the matching columns - will also work with ExpandoObject.

Declaration
public IEnumerable<MatchColumn> MatchColumns { get; set; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<MatchColumn>

PartialCacheSettings

Only need if you set the CacheMode to PartialDbCache. This will only work if you use a DbSource as lookup source.

Declaration
public LookupTransformation<TInput, TSource>.PartialDbCacheSettings PartialCacheSettings { get; set; }
Property Value
Type Description
LookupTransformation.PartialDbCacheSettings<>

ProgressCount

Declaration
public int ProgressCount { get; }
Property Value
Type Description
System.Int32

RetrievalByKeyFunc

The retrieval function that describes how the ingoing data can be enriched with the already pre-read data from

  • this one returns not only a list, but a dictionary that provides faster access to the data. The dictionary key is created with the GetSourceKeyFunc. the Source.
Declaration
public Func<TInput, IDictionary<object, TSource>, TInput> RetrievalByKeyFunc { get; set; }
Property Value
Type Description
System.Func<TInput, System.Collections.Generic.IDictionary<System.Object, TSource>, TInput>

RetrievalFunc

The retrieval function that describes how the ingoing data can be enriched with the already pre-read data from the Source.

Declaration
public Func<TInput, ICollection<TSource>, TInput> RetrievalFunc { get; set; }
Property Value
Type Description
System.Func<TInput, System.Collections.Generic.ICollection<TSource>, TInput>

RetrieveColumns

This collection will be used to define the retrieve columns - will also work with ExpandoObject.

Declaration
public IEnumerable<RetrieveColumn> RetrieveColumns { get; set; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<RetrieveColumn>

Source

The source component from which the lookup data is retrieved. E.g. a DbSource or a MemorySource.

Declaration
public IDataFlowExecutableSource<TSource> Source { get; set; }
Property Value
Type Description
IDataFlowExecutableSource<TSource>

SourceBlock

SourceBlock from the underlying TPL.Dataflow which is used as output buffer for the component.

Declaration
public override ISourceBlock<TInput> SourceBlock { get; }
Property Value
Type Description
System.Threading.Tasks.Dataflow.ISourceBlock<TInput>
Overrides
ETLBox.DataFlow.DataFlowSource<TInput>.SourceBlock

SourceRecords

Holds the data read from the lookup source. This data is used to find data that is missing in the incoming rows.

Declaration
public ICollection<TSource> SourceRecords { get; }
Property Value
Type Description
System.Collections.Generic.ICollection<TSource>

SourceRecordsByKey

Holds a dictionary containing data from the lookup spurce. The dictionary key is generated using the GetSourceRecordKeyFunc

Declaration
public IDictionary<object, TSource> SourceRecordsByKey { get; }
Property Value
Type Description
System.Collections.Generic.IDictionary<System.Object, TSource>

TargetBlock

TargetBlock from the underlying TPL.Dataflow which is used as input buffer for the component.

Declaration
public override ITargetBlock<TInput> TargetBlock { get; }
Property Value
Type Description
System.Threading.Tasks.Dataflow.ITargetBlock<TInput>
Overrides
ETLBox.DataFlow.DataFlowTransformation<TInput, TInput>.TargetBlock

TaskName

A name to identify the task or component. Every component or task comes with a default name that can be overwritten.

Declaration
public override string TaskName { get; set; }
Property Value
Type Description
System.String
Overrides
LoggableTask.TaskName

Methods

CheckParameter()

Declaration
protected override void CheckParameter()
Overrides
DataFlowComponent.CheckParameter()

CleanUpOnFaulted(Exception)

Declaration
protected override void CleanUpOnFaulted(Exception e)
Parameters
Type Name Description
System.Exception e
Overrides
DataFlowComponent.CleanUpOnFaulted(Exception)

CleanUpOnSuccess()

Declaration
protected override void CleanUpOnSuccess()
Overrides
DataFlowComponent.CleanUpOnSuccess()

InitComponent()

Declaration
protected override void InitComponent()
Overrides
DataFlowComponent.InitComponent()

LinkErrorTo(IDataFlowDestination<ETLBoxError>)

Declaration
public IDataFlowSource<ETLBoxError> LinkErrorTo(IDataFlowDestination<ETLBoxError> target)
Parameters
Type Name Description
IDataFlowDestination<ETLBoxError> target
Returns
Type Description
IDataFlowSource<ETLBoxError>

Implements

ILoggableTask
IDataFlowLogging
IDataFlowTransformation<TInput, TOutput>
IDataFlowSource<TOutput>
IDataFlowSource
IDataFlowDestination<TInput>
IDataFlowDestination
IDataFlowComponent
Back to top Crafted with <3 in Berlin
Contact & legal notice