Table of Contents

Search

  1. Preface
  2. Introduction to Informatica Big Data Management
  3. Mappings in the Hadoop Environment
  4. Mapping Sources in the Hadoop Environment
  5. Mapping Targets in the Hadoop Environment
  6. Mapping Transformations in the Hadoop Environment
  7. Processing Hierarchical Data on the Spark Engine
  8. Configuring Transformations to Process Hierarchical Data
  9. Processing Unstructured and Semi-structured Data with an Intelligent Structure Model
  10. Stateful Computing on the Spark Engine
  11. Monitoring Mappings in the Hadoop Environment
  12. Mappings in the Native Environment
  13. Profiles
  14. Native Environment Optimization
  15. Cluster Workflows
  16. Connections
  17. Data Type Reference
  18. Function Reference
  19. Parameter Reference

Big Data Management User Guide

Big Data Management User Guide

Complex Operators

Complex Operators

A complex operator is a type of operator to access elements in a complex data type. The transformation language includes complex operators for complex data types. Use complex operators to access or extract elements in hierarchical data.
The following table lists the complex operators:
Complex Operators
Description
[]
Subscript operator. Use to access array and map elements.
Syntax:
array
[
index
]
  • array
    is the array from which you want to access an element.
  • index
    is the position of an element within an array.
For example, use [0] to access the first element in an one-dimensional array.
Syntax:
map
[
key
]
  • map
    is the map from which you want to access the value corresponding to a key.
  • key
    is the map key for which you want to retrieve the map value.
.
Dot operator. Use to access struct elements.
Syntax:
struct
.
element_name
  • struct
    is the struct from which you want to access an element.
  • element_name
    is the name of the struct element.
Use complex operators in expressions to convert hierarchical data to relational data.
For more information about the operator syntax, return values, and examples, see the
Informatica Developer Transformation Language Reference
.

Complex Operator Examples

  • Convert array data in a JSON file to relational data.
    A JSON file has a quarterly_sales column that is of the array type with integer elements. You develop a mapping to transform the hierarchical data to relational data. The array port quarterly_sales contains four elements. Use subscript operators in expressions to extract the four elements into the four integer ports, q1_sales, q2_sales, q3_sales, and q4_sales.
    The expressions for the integer output port are as follows:
    quarterly_sales[0] quarterly_sales[1] quarterly_sales[2] quarterly_sales[3]
  • Convert struct data in a Parquet file to relational data.
    A Parquet file has an address column that contains customer address as a struct type. You develop a mapping to transform hierarchical data to relational data. The struct port address contains three elements city, state, and zip, of type string. Use dot operators in expressions to extract the three struct elements into the three string ports, city, state, and zip.
    The expressions for the string output port are as follows:
    address.city address.state address.zip

0 COMMENTS

We’d like to hear from you!