Skip to main content
Since 1.16.0 Construct an aggregate that keeps track of the largest values passed through it, as well as some associated data which is passed alongside the value.

Arguments

NameTypeDefaultRequiredDescription
valueBIGINT | DOUBLE PRECISION | TIMESTAMPTZ-The values passed into the aggregate
dataANYELEMENT-The data associated with a particular value
capacityBIGINT-The number of values to retain.

Returns

The compiled aggregate. Note that the exact type will be MaxByInts, MaxByFloats, or MaxByTimes depending on the input type