Skip to main content

max (Aggregate Function)

Returns the maximum value for all the events.

Syntax

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

QUERY PARAMETERS

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

Example 1

    insert into barStream
select max(temp) as maxTemp
from fooStream WINDOW TUMBLING_TIME(10 sec);

max(temp) returns the maximum temp value recorded for all the events based on their arrival and expiration.