@SuppressWarnings("unchecked")
    public SelfT output(ClickHousePassThruStream stream) {
        checkSealed();

        if (!ClickHouseChecker.nonNull(stream, ClickHousePassThruStream.TYPE_NAME).hasOutput()) {
            throw new IllegalArgumentException(ClickHousePassThruStream.ERROR_NO_OUTPUT);
        }

        final ClickHouseConfig c = getConfig();
        if (stream.hasCompression()) {
            compressServerResponse(stream.isCompressed(), stream.getCompressionAlgorithm(),
                    stream.getCompressionLevel());
        } else if (c.isResponseCompressed()) {
            compressServerResponse(false);
        }
        if (stream.hasFormat()) {
            format(stream.getFormat());
        }
        final int bufferSize = c.getWriteBufferSize();
        this.output = changeProperty(PROP_OUTPUT, this.output, ClickHouseDeferredValue
                .of(() -> ClickHouseOutputStream.of(stream, bufferSize, null)));

        return (SelfT) this;
    }
Sets pass-thru stream, to which response will be redirected.

@param stream non-null pass-thru stream
@return the request itself
clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseRequest.java