@Override
    protected StateFactory init(ExpressionExecutor[] attributeExpressionExecutors, ConfigReader configReader,
                                SiddhiQueryContext siddhiQueryContext) {
        if (attributeExpressionExecutors.length != 1) {
            throw new SiddhiAppValidationException("createSet() function has to have exactly 1 parameter, currently " +
                    attributeExpressionExecutors.length + " parameters provided");
        }
        if (!isAttributeTypeSupported(attributeExpressionExecutors[0].getReturnType())) {
            throw new OperationNotSupportedException("createSet() function not supported for type: " +
                    attributeExpressionExecutors[0].getReturnType());
        }
        return null;
    }
Executor class for createSet function. Function execution logic is implemented in execute here.
modules/siddhi-core/src/main/java/io/siddhi/core/executor/function/CreateSetFunctionExecutor.java