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

Flatten Fields

Flatten Fields

You can flatten fields of a complex data type in mappings that run on the Spark engine. You flatten fields in the
Normalizer
view to modify hierarchical data that passes through a complex port.
The output of the flatten action depends on the complex data type. When you flatten an array or struct data type, the Normalizer transformation creates a row for each element in the complex data type. When you flatten a map data type, the Normalizer transformation creates two columns for the map key and map value elements.
The flatten action on a nested data type extracts elements at the first-level. To flatten a nested data type at all levels, use the
Flatten Complex Port
hierarchical conversion wizard in the Developer tool. The
Flatten All
option extracts elements at each level and returns relational data of primitive data type. For more information about hierarchical conversion wizards, see the
Data Engineering Integration User Guide
.
The flatten action changes the value of Occurs column in the Normalizer view to Auto and adds a flatten icon next to the flattened field. The value Auto indicates that the transformation flattens all the elements of the complex data type.
The following image shows a struct that is flattened to a string field with a flatten icon next to it and the Occurs value as Auto:
 On the Properties tab of the Normalizer transformation, the Normalizer view shows the struct field StructEmp that is flattened. A flatten icon is displayed next to the flattened field. The value of Occurs for the flattened field is Auto.
You cannot flatten a multi-occurring field. For example, you cannot flatten an array field with Occurs value as 2.
The following image shows a multi-occurring field of an array data type that you cannot flatten:
 The Normalizer view shows an array field Emp_Id_Name. The value of Occurs for the array field is 2.

0 COMMENTS

We’d like to hear from you!