@SuppressWarnings("unchecked")
    public SelfT reset() {
        checkSealed();

        this.externalTables.clear();
        this.namedParameters.clear();

        this.serverListener = null;

        if (changeListener == null) {
            this.options.clear();
            this.settings.clear();
        } else {
            for (Iterator<ClickHouseOption> it = this.options.keySet().iterator(); it.hasNext();) {
                removeOption(it.next());
            }
            for (Iterator<String> it = this.settings.keySet().iterator(); it.hasNext();) {
                removeSetting(it.next());
            }
        }
        this.input = changeProperty(PROP_DATA, this.input, null);
        this.writer = changeProperty(PROP_WRITER, this.writer, null);
        this.output = changeProperty(PROP_OUTPUT, this.output, null);
        this.sql = changeProperty(PROP_QUERY, this.sql, null);
        this.preparedQuery = changeProperty(PROP_PREPARED_QUERY, this.preparedQuery, null);
        this.queryId = changeProperty(PROP_QUERY_ID, this.queryId, null);

        ClickHouseRequestManager current = managerRef.get();
        if (current != null && managerRef.compareAndSet(current, null)) {
            changeProperty(PROP_MANAGER, current, null);
        }
        ClickHouseTransaction tx = txRef.get();
        if (tx != null && txRef.compareAndSet(tx, null)) {
            changeProperty(PROP_TRANSACTION, tx, null);
        }

        this.changeListener = null;

        resetCache();

        return (SelfT) this;
    }
Resets the request to start all over.

@return the request itself
clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseRequest.java