/** * Execute the query. Can only be called if the query has been authorized. Note that query logs and metrics will * not be emitted automatically when the Sequence is fully iterated. It is the caller's responsibility to call * {@link #emitLogsAndMetrics(Throwable, String, long)} to emit logs and metrics. * * @return result sequence and response context */ public QueryResponse execute() { transition(State.AUTHORIZED, State.EXECUTING); final Map<String, Object> responseContext = DirectDruidClient.makeResponseContextForQuery(); final Sequence res = QueryPlus.wrap(baseQuery) .withIdentity(authenticationResult.getIdentity()) .run(texasRanger, responseContext); return new QueryResponse(res == null ? Sequences.empty() : res, responseContext); }
/** * Execute the query. Can only be called if the query has been authorized. Note that query logs and metrics will * not be emitted automatically when the Sequence is fully iterated. It is the caller's responsibility to call * {@link #emitLogsAndMetrics(Throwable, String, long)} to emit logs and metrics. * * @return result sequence and response context */ public QueryResponse execute() { transition(State.AUTHORIZED, State.EXECUTING); final Map<String, Object> responseContext = DirectDruidClient.makeResponseContextForQuery(); final Sequence res = QueryPlus.wrap(baseQuery) .withIdentity(authenticationResult.getIdentity()) .run(texasRanger, responseContext); return new QueryResponse(res == null ? Sequences.empty() : res, responseContext); }