Table of Contents

Search

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

Transformations

Transformations

Helper code

Helper code

Declare user-defined variables and methods for the Java transformation in the Helper Code section.
The Helper Code section defines the following variables that are used by the Java code in the On Input Row section:
Variable
Description
empMap
Map object that stores the identification number and employee name from the source.
lock
Lock object used to synchronize the access to empMap across partitions.
generateRow
Boolean variable used to determine whether an output row should be generated for the current input row.
isRoot
Boolean variable used to determine whether an employee is at the top of the company organizational chart (root).
Enter the following code in the Helper Code section:
// Static Map object to store the ID and name relationship of an employee. // If a session uses multiple partitions, empMap is shared across all partitions. private static Map <Integer, String> empMap = new HashMap <Integer, String> (); // Static lock object to synchronize the access to empMap across partitions. private static Object lock = new Object(); // Boolean to track whether to generate an output row based on validity of the // input data. private boolean generateRow; // Boolean to track whether the employee is root. private boolean isRoot;
Data Integration
adds the import statements to the Java code for the transformation.

0 COMMENTS

We’d like to hear from you!