Table of Contents

Search

  1. Preface
  2. Transformations
  3. Source transformation
  4. Target transformation
  5. Aggregator transformation
  6. Cleanse transformation
  7. Data Masking transformation
  8. Data Services transformation
  9. Deduplicate transformation
  10. Expression transformation
  11. Filter transformation
  12. Hierarchy Builder transformation
  13. Hierarchy Parser transformation
  14. Hierarchy Processor transformation
  15. Input transformation
  16. Java transformation
  17. Java transformation API reference
  18. Joiner transformation
  19. Labeler transformation
  20. Lookup transformation
  21. Machine Learning transformation
  22. Mapplet transformation
  23. Normalizer transformation
  24. Output transformation
  25. Parse transformation
  26. Python transformation
  27. Rank transformation
  28. Router transformation
  29. Rule Specification transformation
  30. Sequence Generator transformation
  31. Sorter transformation
  32. SQL transformation
  33. Structure Parser transformation
  34. Transaction Control transformation
  35. Union transformation
  36. Velocity transformation
  37. Verifier transformation
  38. Web Services transformation

Transformations

Transformations

Dynamic Lookup example

Dynamic Lookup example

To configure a Lookup transformation to be dynamic, use a dynamic lookup cache.
A dynamic cache is helpful when the source table contains a large amount of data or it contains duplicate primary keys.
The following example illustrates the advantage of using a dynamic cache rather than a static cache when the source table includes duplicate primary keys.
You want to update your payroll table with data from your Human Resources department. The payroll table includes the following data, where ID is the primary key:
ID
Name
Location
1
Abhi
USA
2
Alice
UK
You create a mapping with a Lookup transformation and use the payroll table for the target and the lookup cache. You configure the cache to be dynamic because you expect the Human Resources department's table to contain duplicate keys.
In the mapping, you specify the Human Resources department's table to be the source. The source table includes the following data:
ID
Name
Location
1
Abhi
India
2
Alice
UK
3
James
Japan
3
James
USA
You create a
mapping
task to update the payroll table. When the
mapping
task begins, it creates the cache file that contains the rows in the target table. As the task processes the rows, it flags the first row as an update and it updates the cache. It flags the third row as an insert and inserts the row in the cache. It flags the fourth row as an update because the row exists in the cache.
If you follow the same scenario using a static cache, the task flags the fourth row as an insert. The cache does not contain the row for James because it does not update as the task processes the rows. The target database produces an error because it cannot handle two rows with the same primary key.

0 COMMENTS

We’d like to hear from you!