@Override
    protected StateFactory init(ExpressionExecutor[] attributeExpressionExecutors, ConfigReader configReader,
                                SiddhiQueryContext siddhiQueryContext) {
        if (attributeExpressionExecutors.length == 1) {
            if (attributeExpressionExecutors[0].getReturnType() != Attribute.Type.STRING) {
                throw new SiddhiAppValidationException("Only string values are supported for single within clause "
                        + "but found, " + attributeExpressionExecutors[0].getReturnType());
            }
        } else if (attributeExpressionExecutors.length == 2) {
            if (!(attributeExpressionExecutors[0].getReturnType() == Attribute.Type.LONG
                    || attributeExpressionExecutors[0].getReturnType() == Attribute.Type.STRING)) {
                throw new SiddhiAppValidationException(
                        "Only string and long types are supported as first value of within clause");
            }
            if (!(attributeExpressionExecutors[1].getReturnType() == Attribute.Type.LONG
                    || attributeExpressionExecutors[1].getReturnType() == Attribute.Type.STRING)) {
                throw new SiddhiAppValidationException(
                        "Only string and long types are supported as second value of within clause");
            }
        } else {
            throw new SiddhiAppValidationException("incrementalAggregator:startTimeEndTime() function accepts " +
                    "only one or two arguments, but found " + attributeExpressionExecutors.length);
        }
        return null;
    }
Executor class for finding the start time and end time of the within clause in incremental processing.
This is important when retrieving incremental aggregate values by specifying a time range with 'within' clause.
modules/siddhi-core/src/main/java/io/siddhi/core/executor/incremental/IncrementalStartTimeEndTimeFunctionExecutor.java