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. Deduplicate transformation
  9. Expression transformation
  10. Filter transformation
  11. Hierarchy Builder transformation
  12. Hierarchy Parser transformation
  13. Hierarchy Processor transformation
  14. Input transformation
  15. Java transformation
  16. Java transformation API reference
  17. Joiner transformation
  18. Labeler transformation
  19. Lookup transformation
  20. Mapplet transformation
  21. Normalizer transformation
  22. Output transformation
  23. Parse transformation
  24. Python transformation
  25. Rank transformation
  26. Router transformation
  27. Rule Specification transformation
  28. Sequence Generator transformation
  29. Sorter transformation
  30. SQL transformation
  31. Structure Parser transformation
  32. Transaction Control transformation
  33. Union transformation
  34. Velocity transformation
  35. Verifier transformation
  36. Web Services transformation

Transformations

Transformations

Data type conversion

Data type conversion

A Java transformation converts
Data Integration
transformation data types to Java data types, based on the Java transformation field type.
When a Java transformation reads input rows, it converts input field data types to Java data types. When a Java transformation writes output rows, it converts Java data types to output field data types.
For example, the following processing occurs for an input field with the integer data type in a Java transformation:
  1. The Java transformation converts the integer data type of the input field to the Java primitive int data type.
  2. In the transformation, the transformation treats the value of the input field as the Java primitive int data type.
  3. When the transformation generates the output row, it converts the Java primitive int data type to the integer data type.
The following table shows how the Java transformation maps the
Data Integration
transformation data types to Java primitive and complex data types:
Transformation data type
Java Data Type
bigint
long
binary
byte[]
date/time
BigDecimal
long (number of milliseconds since January 1, 1970 00:00:00.000 GMT)
decimal
double
BigDecimal
double
double
integer
int
string
String
text
String
In Java, the String, byte[], and BigDecimal data types are complex data types, and the double, int, and long data types are primitive data types.
The Java transformation sets null values in primitive data types to zero. You can use the isNull and the setNull API methods in the On Input Row section of the Java editor to set null values in the input field to null values in the output field. For an example, see setNull.
The decimal data type maps to BigDecimal when high precision is enabled. BigDecimal cannot be used with some operators, such as the
+
operator. If the Java code contains an expression that uses a decimal field and the field is used with one of the operators, the Java code fails to compile.