Skip to main content

deduplicate (Stream Processor)

Removes duplicate events based on the unique.key parameter that arrive within the time.interval gap from one another.

Syntax

unique:deduplicate(<INT|LONG|FLOAT|BOOL|DOUBLE|STRING> unique.key, <INT|LONG> time.interval)

Query Parameters

NameDescriptionDefault ValuePossible Data TypesOptionalDynamic
unique.keyParameter to uniquely identify events.INT LONG FLOAT BOOL DOUBLE STRINGNoYes
time.intervalThe sliding time period within which the duplicate events are dropped.INT LONGNoNo

Example 1

CREATE STREAM TemperatureStream (sensorId string, temperature double)

insert into UniqueTemperatureStream
select *
from TemperatureStream#unique:deduplicate(sensorId, 30 sec);

Query that removes duplicate events of TemperatureStream stream based on sensorId attribute when they arrive within 30 seconds.