@Override
    protected StateFactory<MinAggregatorState> init(ExpressionExecutor[] attributeExpressionExecutors,
                                                    ProcessingMode processingMode,
                                                    boolean outputExpectsExpiredEvents, ConfigReader configReader,
                                                    SiddhiQueryContext siddhiQueryContext) {
        if (attributeExpressionExecutors.length != 1) {
            throw new OperationNotSupportedException("Min aggregator has to have exactly 1 parameter, currently " +
                    attributeExpressionExecutors.length + " parameters provided");
        }
        boolean trackFutureStates = false;
        if (processingMode == ProcessingMode.SLIDE || outputExpectsExpiredEvents) {
            trackFutureStates = true;
        }
        returnType = attributeExpressionExecutors[0].getReturnType();
        boolean finalTrackFutureStates = trackFutureStates;
        return new StateFactory<MinAggregatorState>() {
            @Override
            public MinAggregatorState createNewState() {
                switch (returnType) {
                    case FLOAT:
                        return new MinAttributeAggregatorStateFloat(finalTrackFutureStates);
                    case INT:
                        return new MinAttributeAggregatorStateInt(finalTrackFutureStates);
                    case LONG:
                        return new MinAttributeAggregatorStateLong(finalTrackFutureStates);
                    case DOUBLE:
                        return new MinAttributeAggregatorStateDouble(finalTrackFutureStates);
                    default:
                        throw new OperationNotSupportedException("Min not supported for " + returnType);
                }
            }
        };

    }
The initialization method for FunctionExecutor

@param attributeExpressionExecutors are the executors of each attributes in the function
@param processingMode               query processing mode
@param outputExpectsExpiredEvents   is expired events sent as output
@param configReader                 this hold the {@link MinAttributeAggregatorExecutor} configuration reader.
@param siddhiQueryContext           Siddhi query runtime context
modules/siddhi-core/src/main/java/io/siddhi/core/query/selector/attribute/aggregator/MinAttributeAggregatorExecutor.java