Skip to main content

minForever (Aggregate Function)

This is the attribute aggregator to store the minimum value for a given attribute throughout the lifetime of the query regardless of any windows.

Syntax

<INT|LONG|DOUBLE|FLOAT> minForever(<INT|LONG|DOUBLE|FLOAT> arg)

Query Parameters

NameDescriptionDefault ValuePossible Data TypesOptionalDynamic
argThe value that needs to be compared to find the minimum value.INT LONG DOUBLE FLOATNoYes

Example

@info(name = 'query1')
INSERT INTO outputStream
SELECT minForever(temp) AS min
FROM inputStream;

This query, named 'query1', calculates the minimum temperature (min) encountered in the inputStream since the start of the stream processing using the minForever(temp) function. The resulting minimum temperature is then inserted into the outputStream.

Essentially, this query processes records in the inputStream, calculates the minimum temperature seen so far, and then creates new records in the outputStream with the calculated min value.