@Override
    public Expression aggregate() {
        return Expression.function("sizeOfSet", Expression.variable(baseAttributes[0].getName()));
    }
{@link IncrementalAttributeAggregator} to calculate count based on an event attribute.
modules/siddhi-core/src/main/java/io/siddhi/core/query/selector/attribute/aggregator/incremental/DistinctCountIncrementalAttributeAggregator.java