You want to calculate the maximum value of a stock price every five minutes for stock prices collected over a five-minute time interval. You can use a tumbling Window transformation.
Create a mapping that reads stock prices and calculates the maximum value every five minute.
The following figure shows the example mapping:
You can use the following objects in your mapping:
The input, Stock_Read, is a Kafka broker.
The Window transformation, Window_Tumbling, accumulates data and returns a data group every five minute. Configure a window size of 5 minutes. The default slide interval is 5 minutes. The transformation streams data for five minutes and returns a data group every five minutes.
The Aggregator transformation calculates the maximum value of the stock price.
The output, Stock_Write, is a Kafka broker.
When you run the mapping, the Data Integration Service reads the data from the Kafka broker and passes it to the Window transformation. The window transformation groups the data and provides a data group every five minutes. The Aggregator transformation provides the maximum stock price. The output is written to a Kafka broker.