Skip to main content

createSet (Function)

Includes the given input parameter in a java.util.HashSet and returns the set.

Syntax

<OBJECT> createSet(<INT|LONG|DOUBLE|FLOAT|STRING|BOOL> input)

Query Parameters

NameDescriptionDefault ValuePossible Data TypesOptionalDynamic
inputThe input that needs to be added into the set.INT LONG DOUBLE FLOAT STRING BOOLNoYes

Example 1

@info(name = 'query1')
INSERT INTO initStream
SELECT createSet(symbol) AS initialSet
FROM stockStream;

This query selects records from the stockStream and uses the createSet function to create a set containing unique symbol values. The result is aliased as initialSet and inserted into the initStream.

Essentially, this query processes records in the stockStream and creates new records in the initStream with a unique set of symbol values.