Table of Contents

Search

  1. Preface
  2. Introduction to Transformations
  3. Transformation Ports
  4. Transformation Caches
  5. Address Validator Transformation
  6. Aggregator Transformation
  7. Association Transformation
  8. Bad Record Exception Transformation
  9. Case Converter Transformation
  10. Classifier Transformation
  11. Comparison Transformation
  12. Consolidation Transformation
  13. Data Masking Transformation
  14. Data Processor Transformation
  15. Decision Transformation
  16. Duplicate Record Exception Transformation
  17. Expression Transformation
  18. Filter Transformation
  19. Hierarchical to Relational Transformation
  20. Java Transformation
  21. Java Transformation API Reference
  22. Java Expressions
  23. Joiner Transformation
  24. Key Generator Transformation
  25. Labeler Transformation
  26. Lookup Transformation
  27. Lookup Caches
  28. Dynamic Lookup Cache
  29. Macro Transformation
  30. Match Transformation
  31. Match Transformations in Field Analysis
  32. Match Transformations in Identity Analysis
  33. Normalizer Transformation
  34. Merge Transformation
  35. Parser Transformation
  36. Python Transformation
  37. Rank Transformation
  38. Read Transformation
  39. Relational to Hierarchical Transformation
  40. REST Web Service Consumer Transformation
  41. Router Transformation
  42. Sequence Generator Transformation
  43. Sorter Transformation
  44. SQL Transformation
  45. Standardizer Transformation
  46. Union Transformation
  47. Update Strategy Transformation
  48. Web Service Consumer Transformation
  49. Parsing Web Service SOAP Messages
  50. Generating Web Service SOAP Messages
  51. Weighted Average Transformation
  52. Window Transformation
  53. Write Transformation
  54. Appendix A: Transformation Delimiters

Developer Transformation Guide

Developer Transformation Guide

Data Type Conversion

Data Type Conversion

A Java transformation converts
Developer tool
data types to Java data types, based on the Java transformation port type.
When a Java transformation reads input rows, it converts input port data types to Java data types.
When a Java transformation writes output rows, it converts Java data types to output port data types.
For example, the following processing occurs for an input port with the integer data type in a Java transformation:
  1. The Java transformation converts the integer data type of the input port to the Java primitive int data type.
  2. In the transformation, the transformation treats the value of the input port 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
Developer tool
data types to Java primitive and complex data types:
Developer Tool Data Type
Java Data Type
array*
java.util.List
bigint
long
binary
byte[]
date/time
With nanoseconds processing enabled, BigDecimal with nanosecond precision
With nanoseconds processing disabled, long with millisecond precision (the number of milliseconds since January 1, 1970 00:00:00.000 GMT)
decimal
With high precision processing disabled, double with precision 15
With high precision processing enabled, BigDecimal
double
double
integer
int
map*
java.util.Map
string
String
struct*
Customized JavaBean class with getters and setters for the struct field elements
text
String
* Supported only on the Spark engine.
In Java, the java.util.List, java.util.Map, String, byte[], and BigDecimal data types are complex data types. The double, int, and long data types are primitive data types.
In the Developer tool, array, struct, and map data types are complex data types.
The Java transformation sets null values in primitive data types to zero. You can use the isNull and the setNull API methods on the
On Input
tab to set null values in the input port to null values in the output port. 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 port or a complex port with an element of a decimal data type and the port is used with one of the operators, the Java code fails to compile.

0 COMMENTS

We’d like to hear from you!