What is Dynamic Lookup?
When lookup used Dynamic Cache then it's called as a Dynamic Lookup.
在property tab里勾上dynamic lookup的check box
What is Dynamic Cache?
Dynamic Cache may get updated during mapping run. Means new records would be inserted and updated records would be updated in cache during mapping run.
从底层算法上,lookup的index cache是joiner的两倍,data cache和joiner齐平
How to create Dynamic Looup
Lookup Transformation-->RightClickà EditàProperties Tab
Dynamic Lookup CacheOption (Check) (Check box should be check)
Properties of Dynamic Lookup
NewLookupRow
You will get this default port as soon as you checked option for dynamic lookup. In this port you will get three values
0 (For No Operation at Cache)
1 (If record inserted into Cache)
2 (If record Updated in Cache)
利用NewlookupRow可以实现Dedup和Incremental Update.
Associated Expression
This option we need to set for each and every lookup port means if you have checked all port as lookup port then we need to set associated port for each and every lookup port. (Basically value in lookup port compared with value of Associated Expression to decide whether Lookup Cache has to insert or update, If so then Lookup Cache will be updated with value of Associated port.)
Lookup SQL Override
Yahoo!!! Here also, we can override SQL according to our need; If Lookup table is relational table.
For Updating LookupCache we need to set some more properties. You can choose either ofoption according to your need
a.Insert Else Update
b.Update Else Insert
It’s totally depends on row type, means which type of rows are entering to lookup, is it insert or update.
Ex: I have use update Strategy before lookup and based upon some condition I am flagging record as DD_UPDATE then row type becomes as update.So, in a simple word if you are passing records from update strategy with(DD_UPDATE) to Lookup then Choose Update Else Inset otherwise choose Insert Else Update. Be careful while choosing this option otherwise your cache won’t be updated.
Output Old Value on Update
Check box option… Select it according to your requirement if you need lookup to return old value after updating cache with new value.
Update Dynamic Cache Condition
Through this option we can develop expression. When an expression evaluation is true then only update Cache. Ex: (Source_Sal!= LKP_Sal)