presto-main/src/main/java/io/prestosql/operator/scalar/ArrayToArrayCast.java/ArrayToArrayCast/specialize
class ArrayToArrayCast:    @Override
    public ScalarFunctionImplementation specialize(BoundVariables boundVariables, int arity, Metadata metadata)
    {
        checkArgument(arity == 1, "Expected arity to be 1");
        Type fromType = boundVariables.getTypeVariable("F");
        Type toType = boundVariables.getTypeVariable("T");

        ResolvedFunction resolvedFunction = metadata.getCoercion(fromType, toType);
        ScalarFunctionImplementation function = metadata.getScalarFunctionImplementation(resolvedFunction);
        Class<?> castOperatorClass = generateArrayCast(metadata, resolvedFunction.getSignature(), function);
        MethodHandle methodHandle = methodHandle(castOperatorClass, "castArray", ConnectorSession.class, Block.class);
        return new ScalarFunctionImplementation(
                false,
                ImmutableList.of(valueTypeArgumentProperty(RETURN_NULL_ON_NULL)),
                methodHandle);
    }