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

Defining input row behavior

Defining input row behavior

You can define the behavior of the Java transformation when it receives an input row. Define input row behavior in the On Input Row section of the Java editor. The Java code in this section executes one time for each input row.
Access and use the following input and output field data, variables, and methods in the On Input Row section:
Input field and output field variables
Access input and output field data as a variable by using the name of the field as the name of the variable. For example, if “in_int” is an integer input field, you can access the data for this field by referring as a variable “in_int” with the Java primitive data type int. You do not need to declare input and output fields as variables.
Do not assign a value to an input field variable. If you assign a value to an input variable in the On Input Row section, you cannot get the input data for the corresponding field in the current row.
Static variables and user-defined methods
Use any static variable or user-defined method that you declared in the Helper Code section.
For example, an active Java transformation has two input fields, BASE_SALARY and BONUSES, with an integer data type, and a single output field, TOTAL_COMP, with an integer data type. You create a user-defined method in the Helper Code section, myTXAdd, that adds two integers and returns the result.
Use the following Java code in the On Input Row section to assign the total values for the input fields to the output field and generate an output row:
TOTAL_COMP = myTXAdd (BASE_SALARY,BONUSES); generateRow();
When the Java transformation receives an input row, it adds the values of the BASE_SALARY and BONUSES input fields, assigns the value to the TOTAL_COMP output field, and generates an output row.
Java transformation API methods
You can call API methods provided by the Java transformation.

0 COMMENTS

We’d like to hear from you!