@Override
    @SuppressWarnings("unchecked")
    public <E> E[] asArray(Class<E> clazz) {
        T[] v = getValue();
        E[] array = (E[]) Array.newInstance(ClickHouseChecker.nonNull(clazz, ClickHouseValues.TYPE_CLASS), v.length);
        int index = 0;
        for (T o : v) {
            array[index++] = clazz.cast(o);
        }
        return array;
    }
Update value of the given object or create a new instance if {@code ref} is
null.

@param <T>   type of element
@param ref   object to update, could be null
@param value value
@return same object as {@code ref} or a new instance if it's null
clickhouse-data/src/main/java/com/clickhouse/data/value/ClickHouseArrayValue.java