@Override
    public Object evaluate(DeferredObject[] arguments) throws HiveException {
        Object array = arguments[ARRAY_IDX].get();

        if (arrayOI.getListLength(array) <= 0) {
            return null;
        }

        List retArray = ((ListObjectInspector) argumentOIs[ARRAY_IDX]).getList(array);
        Optional value = retArray.stream().filter(Objects::nonNull).min(Comparator.naturalOrder());
        return value.isPresent() ? value.get() : null;
    }
Generic UDF to find out min from array elements
<code>ARRAY_MIN(array(obj1, obj2, obj3...))</code>.

@see GenericUDF
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFArrayMin.java