class ArrayAppendFunction extends Scalar<List<Object>, Object> {

    public static final String NAME = "array_append";

    public static void register(Functions.Builder builder) {
        builder.add(
            Signature.scalar(
                    NAME,
                    TypeSignature.parse("array(E)"),
                    TypeSignature.parse("E"),
                    TypeSignature.parse("array(E)")
                ).withTypeVariableConstraints(typeVariable("E"))
                .withFeature(Feature.NON_NULLABLE),
            ArrayAppendFunction::new
        );
    }

    private final DataType<?> innerType;

    ArrayAppendFunction(Signature signature, BoundSignature boundSignature) {
        super(signature, boundSignature);
        this.innerType = ((ArrayType<?>) boundSignature.returnType()).innerType();
    }

    @Override
    public final List<Object> evaluate(TransactionContext txnCtx, NodeContext nodeCtx, Input[] args) {<FILL_FUNCTION_BODY>}
}

        ArrayList<Object> resultList = new ArrayList<>();
        @SuppressWarnings("unchecked")
        List<Object> values = (List<Object>) args[0].value();
        Object valueToAdd = args[1].value();
        if (values != null) {
            for (Object value : values) {
                resultList.add(innerType.sanitizeValue(value));
            }
        }
        resultList.add(innerType.sanitizeValue(valueToAdd));
        return resultList;
    
<methods>public BoundSignature boundSignature() ,public Scalar<List<java.lang.Object>,java.lang.Object> compile(List<io.crate.expression.symbol.Symbol>, java.lang.String, io.crate.role.Roles) ,public transient abstract List<java.lang.Object> evaluate(io.crate.metadata.TransactionContext, io.crate.metadata.NodeContext, Input<java.lang.Object>[]) ,public io.crate.expression.symbol.Symbol normalizeSymbol(io.crate.expression.symbol.Function, io.crate.metadata.TransactionContext, io.crate.metadata.NodeContext) ,public io.crate.metadata.functions.Signature signature() <variables>public static final Set<io.crate.metadata.Scalar.Feature> DETERMINISTIC_AND_COMPARISON_REPLACEMENT,public static final Set<io.crate.metadata.Scalar.Feature> DETERMINISTIC_ONLY,public static final Set<io.crate.metadata.Scalar.Feature> NO_FEATURES,protected final non-sealed BoundSignature boundSignature,protected final non-sealed io.crate.metadata.functions.Signature signature