static CompletableFuture<ClickHouseResponseSummary> dump(ClickHouseNode server, String tableOrQuery,
            ClickHousePassThruStream stream) {
        if (server == null || tableOrQuery == null || stream == null) {
            throw new IllegalArgumentException("Non-null server, tableOrQuery, and pass-thru stream are required");
        }

        // in case the protocol is ANY
        final ClickHouseNode theServer = server.probe();

        final String theQuery = tableOrQuery.trim();

        return submit(() -> {
            try (ClickHouseClient client = newInstance(theServer.getProtocol())) {
                ClickHouseRequest<?> request = client.read(theServer).output(stream);
                // FIXME what if the table name is `try me`?
                if (theQuery.indexOf(' ') < 0) {
                    request.table(theQuery);
                } else {
                    request.query(theQuery);
                }

                try (ClickHouseResponse response = request.executeAndWait()) {
                    return response.getSummary();
                }
            }
        });
    }
Dumps a table or query result from server into the given pass-thru stream.
Pass {@link com.clickhouse.data.ClickHouseFile} to dump data into a file,
which may or may not be compressed.

@param server       non-null server to connect to
@param tableOrQuery table name or a select query
@param stream       non-null pass-thru stream
@return non-null future object to get result
@throws IllegalArgumentException if any of server, tableOrQuery, and output
                                 is null
@throws CompletionException      when error occurred during execution
clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseClient.java