Buffer Transformation Assembly


Number of input and output link

Number of input link : One
Number of output link : One

Buffer Transformation Assembly () is used to transform grouped data or grouped streams by applying buffer-based transformation functions.
Unlike Aggregator Assembly (which reduces data into aggregated results), Buffer Transformation can produce transformed records per row, per change, or per group, depending on the emit mode.

This assembly must operate on grouped data, meaning it logically follows a Group By process.

Key Characteristics

Built-in Buffer Transformation Functions

  1. Bult-in
    • Sum
      Calculates the sum of values in a field within a group.
    • Max
      Calculates the minimum of values in a field within a group.
    • Min
      Calculate the minimum of value of a field
    • Average
      Calculates the average value of a field in a group.
    • Count
      Calculates the number of records in a group.
    • Rank
      Calculates rank ordering within a group.

      Rank Parameter Options
      ParameterDescriptionExample
      0 (default) Multi-rank without gap 1, 2, 2, 3, 3, 4
      1Multi-rank with gap 1, 2, 2, 4, 4, 6
      2 Single rank (strict ordering) 1, 2, 3, 4, 5, 6
    • StandardDeviation
      Calculates the standard deviation of values in a field.
    • First
      Returns the first value of a field in a group or sub-group.
    • Last
      Finds the last value of a group or sub-group
    • FirstNextChange
      Finds the first value of the next group or sub-group after a change occurs.
    • DistanceFromPrevious
      Retrieves the previous record’s value for a field.
    • ValueFromPrevious
      Get the previous value
    • Sequence
      Generates a sequential number for records in a group.
    • Route
      Identifies the route or path of values of a field within a group or sub-group.
    • Concate
      Concatenates values of a field within a group or sub-group.
    • SimpleCalculation
      Performs a simple arithmetic calculation using field values in the same record.
    • Pareto
      Calculates Pareto (80/20) distribution values, commonly used in business analytics.
  2. Custom
    Allows user-defined buffer transformation logic function.

Emit Modes (Output Behavior)

Buffer Transformation supports three emit strategies:
  1. EMIT FOR EVERY RECORD
    • Output is emitted for each input record
    • Suitable for:
      • Running totals
      • Sequence numbers
      • ValueFromPrevious
  2. EMIT ON CHANGE
    • Output is emitted only when a field value (or combination of fields) changes
    • Suitable for:
      • Change detection
      • State transition analysis
      • Slowly changing data
  3. EMIT FOR EVERY GROUP
    • Output is emitted once per group
    • Suitable for:
      • Group summaries
      • Final transformation results

Buffer Transformation vs Aggregator

Aspect Aggregator Buffer Transformation
Input Grouped data Grouped data
Output One row per group Flexible
Access to full group ❌ Limited ✅ Full
Running calculations ❌ ✅
Ranking & sequencing ❌ ✅
Memory usage Low Higher

Performance Considerations

Typical Use Cases



A short tutorial on Using Buffer Transformation

Supported Engines

Map
Reduce
Spark 1.x
RDD
Spark 2.x
RDD
Spark 2.x
Dataset
Apache Beam
2.29.0 Batch
Apache Beam
2.29.0 Streaming
Apache Flink
1.12.0 Batch
Apache Flink
1.12.0 Streaming
Apache Tez
0.9.1
PySpark