protected static CompletableFuture<Void> writeAsync(ClickHouseWriter writer, ClickHousePipedOutputStream output) {
        return ClickHouseDataStreamFactory.getInstance().runBlockingTask(() -> {
            try (ClickHouseOutputStream out = output) {
                writer.write(out);
            } catch (Exception e) {
                throw new CompletionException(e);
            }
            return null;
        });
    }
Writes data to the piped output stream in a separate thread. The given piped
output stream will be closed automatically at the end of writing.

@param writer non-null custom writer
@param output non-null piped output stream
@return non-null future
clickhouse-data/src/main/java/com/clickhouse/data/ClickHousePipedOutputStream.java