Skip to main content

unionSet (Aggregate Function)

Union multiple sets. This attribute aggregator maintains a union of sets. The given input set is put into the union set and the union set is returned.

Syntax

    <OBJECT> unionSet(<OBJECT> set)

QUERY PARAMETERS

NameDescriptionDefault ValuePossible Data TypesOptionalDynamic
setThe java.util.Set object that needs to be added into the union set.OBJECTNoYes

Example 1

    insert into initStream
select createSet(symbol) as initialSet
from stockStream

insert into distinctStockStream
select unionSet(initialSet) as distinctSymbols
from initStream WINDOW TUMBLING_TIME(10 sec);

distinctStockStream returns the set object which contains the distinct set of stock symbols received during a sliding window of 10 seconds.