public void eval(Object... args) throws HiveException {

        // When the parameter is (Integer, Array[Double]), Flink calls udf.eval(Integer,
        // Array[Double]), which is not a problem.
        // But when the parameter is a single array, Flink calls udf.eval(Array[Double]),
        // at this point java's var-args will cast Array[Double] to Array[Object] and let it be
        // Object... args, So we need wrap it.
        if (isArgsSingleArray) {
            args = new Object[] {args};
        }

        checkArgument(args.length == conversions.length);

        if (!allIdentityConverter) {
            for (int i = 0; i < args.length; i++) {
                args[i] = conversions[i].toHiveObject(args[i]);
            }
        }

        function.process(args);
    }
@Test
    public void testArray() throws Exception {
        Object[] constantArgs = new Object[] {null};

        DataType[] dataTypes = new DataType[] {DataTypes.ARRAY(DataTypes.INT())};

        HiveGenericUDTF udf = init(GenericUDTFPosExplode.class, constantArgs, dataTypes);

        udf.eval(new Integer[] {1, 2, 3});

        assertThat(collector.result)
                .isEqualTo(Arrays.asList(Row.of(0, 1), Row.of(1, 2), Row.of(2, 3)));
    }