@Override
    public <E> E[] asArray(Class<E> clazz) {
        long[] v = getValue();
        int len = v.length;
        if (clazz == BigInteger.class) {
            BigInteger[] array = new BigInteger[len];
            for (int i = 0; i < len; i++) {
                long value = v[i];
                array[i] = BigInteger.valueOf(value);
                if (value < 0L) {
                    array[i] = array[i].and(UnsignedLong.MASK);
                }
            }
            return (E[]) array;
        } else {
            E[] array = ClickHouseValues.createObjectArray(clazz, len, 1);
            for (int i = 0; i < len; i++) {
                array[i] = clazz.cast(v[i]);
            }
            return array;
        }
    }
Update value of the given object or create a new instance if {@code ref} is
null.

@param ref      object to update, could be null
@param value    value
@param unsigned true if {@code value} is unsigned; false otherwise
@return same object as {@code ref} or a new instance if it's null
clickhouse-data/src/main/java/com/clickhouse/data/value/array/ClickHouseLongArrayValue.java