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

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.

0 COMMENTS

We’d like to hear from you!