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

Nested Aggregate Functions

Nested Aggregate Functions

A nested aggregate function in a window function performs a calculation separately for each partition. A nested aggregate function behaves differently in a window function and an Aggregator transformation.
A nested aggregate function in an Aggregator transformation performs a calculation globally across all rows. A nested aggregate function in an Expression transformation performs a separate calculation for each partition.
For example, you configure the following nested aggregate function in an Aggregator transformation and an Expression transformation:
MEDIAN ( COUNT ( P1 ) )
You define P2 as the group by port in the Aggregator transformation.
The function takes the median of the count of the following set of data:
P1
P2
10
1
7
1
12
1
11
2
13
2
8
2
10
2
RETURN VALUE: 3.5
When you include nested aggregate functions in an Expression transformation and configure the transformation for windowing, the function performs the calculation separately for each partition.
You partition the data by P2 and specify a frame of all rows preceding and all rows following. The window function performs the following calculations:
  1. COUNT (P1) produces one value for every row. COUNT returns the number of rows in the partition that have non-null values.
  2. MEDIAN of that value produces the median of a window of values generated by COUNT.
The window function produces the following outputs:
P1
P2
Output
10
1
3
7
1
3
12
1
3
11
2
4
13
2
4
8
2
4
10
2
4
You can nest aggregate functions with multiple window functions. For example:
LAG ( LEAD( MAX( FIRST ( p1 )))
You can nest any number of the window functions LEAD and LAG, but you cannot nest more than one aggregate function within another aggregate function.

0 COMMENTS

We’d like to hear from you!