@Override
    public StateFactory init(ExpressionExecutor[] attributeExpressionExecutors, ConfigReader configReader,
                             SiddhiQueryContext siddhiQueryContext) {
        if (attributeExpressionExecutors.length == 0) {
            throw new SiddhiAppValidationException("Coalesce must have at least one parameter");
        }
        Attribute.Type type = attributeExpressionExecutors[0].getReturnType();
        for (ExpressionExecutor expressionExecutor : attributeExpressionExecutors) {
            if (type != expressionExecutor.getReturnType()) {
                throw new SiddhiAppValidationException("Coalesce cannot have parameters with different type");
            }
        }
        returnType = type;
        return null;
    }
Executor class for coalesce function. Returns the value of the first input parameter that is not null.
modules/siddhi-core/src/main/java/io/siddhi/core/executor/function/CoalesceFunctionExecutor.java