@Override
    public <T> Publisher<T> flatMap(Function<Segment, ? extends Publisher<? extends T>> function) {
        return segments.flatMap(segment -> {
            try {
                Publisher<? extends T> retValue = function.apply(segment);
                if (retValue == null) {
                    return Mono.error(new IllegalStateException("flatmap function returned null value"));
                }
                return retValue;
            } catch (Exception e) {
                log.error("Provided function caused exception:", e);
                return Mono.error(e);
            }
        });
    }
Returns updated count(written rows from summary of {@link ClickHouseResponse}).Important! if writtenRows is greater than MAX_INT then it will return MAX_INT.

@return updated count
clickhouse-r2dbc/src/main/java/com/clickhouse/r2dbc/ClickHouseResult091.java