public ClickHouseRequest<SelfT> seal() {
        ClickHouseRequest<SelfT> req = this;

        if (!isSealed()) {
            // no idea which node we'll connect to until now
            req = new ClickHouseRequest<>(client, getServer(), serverRef, options, true);
            if (options.isFreezed()) {
                req.options.freeze();
            }
            req.externalTables.addAll(externalTables);
            req.settings.putAll(settings);
            if (settings.isFreezed()) {
                req.settings.freeze();
            }

            req.namedParameters.putAll(namedParameters);

            req.input = input;
            req.writer = writer;
            req.output = output;
            req.queryId = queryId;
            req.sql = sql;
            req.preparedQuery = preparedQuery;
            req.managerRef.set(managerRef.get());
            req.txRef.set(txRef.get());
        }

        return req;
    }
Creates a sealed request, which is an immutable copy of the current request.
Listeners won't be copied to the sealed instance, because it's immutable.

@return sealed request, an immutable copy of the current request
clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseRequest.java