Evaluates the query and returns the hits that match the query.

@param query           the query to execute.
@return the query hits.
@throws IOException if an error occurs while executing the query.
501745
public QueryHits evaluate(Query query) throws IOException
   {
      return evaluate(query, new Sort(), Integer.MAX_VALUE);
   }
1213521
public ResultSet execute(String keyspace, @NotNull String query) {
        getMetricsFactory().getCounter(MetricsType.CASSANDRA_QUERIES_COUNT.name()).inc();

        Timer time = getMetricsFactory().getTimer(MetricsType.CASSANDRA_EXECUTE.name());

        ResultSet resultSet = getOrCreateSession(keyspace).execute(query);
        time.stop();

        return resultSet;
    }
126114
private void handleExpressionQuery(final TSDB tsdb, final HttpQuery query) {
    final net.opentsdb.query.pojo.Query v2_query = 
        JSON.parseToObject(query.getContent(), net.opentsdb.query.pojo.Query.class);
    v2_query.validate();

    checkAuthorization(tsdb, query.channel(), v2_query);

    final QueryExecutor executor = new QueryExecutor(tsdb, v2_query);
    executor.execute(query);
  }
844084
public ApiResponse<Integer> executeDeletePostWithHttpInfo(Query query) throws ApiException {
        com.squareup.okhttp.Call call = executeDeletePostValidateBeforeCall(query, null, null);
        Type localVarReturnType = new TypeToken<Integer>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }
1061486
public QueryResult executeQuery(String query) throws FMSException {

        IntuitMessage intuitMessage = prepareQuery(query);

        // execute interceptors
        executeInterceptors(intuitMessage);

        QueryResult queryResult = null;

        // Iterate the IntuitObjects list in QueryResponse and convert to <T> entity
        IntuitResponse intuitResponse = (IntuitResponse) intuitMessage.getResponseElements().getResponse();
        if (intuitResponse != null) {
            QueryResponse queryResponse = intuitResponse.getQueryResponse();
            if (queryResponse != null) {
                queryResult = getQueryResult(queryResponse);
            }
        }
        return queryResult;
    }
1141654
public ApiResponse<QueryResponse> executeQueryPostWithHttpInfo(Query query) throws ApiException {
        com.squareup.okhttp.Call call = executeQueryPostValidateBeforeCall(query, null, null);
        Type localVarReturnType = new TypeToken<QueryResponse>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }
470454
private List<?> getResultList(Query query) {
        // TODO : use lazy fetch here?
        if (projection != null) {
            List<?> results = query.getResultList();
            List<Object> rv = new ArrayList<Object>(results.size());
            for (Object o : results) {
                if (o != null) {
                    if (!o.getClass().isArray()) {
                        o = new Object[]{o};
                    }
                    rv.add(projection.newInstance((Object[]) o));
                } else {
                    rv.add(null);
                }
            }
            return rv;
        } else {
            return query.getResultList();
        }
    }
470089
public int countObjects(@Nonnull String query) {
        try (Stream<Path> stream = Files.list(file.toPath())) {
            return Math.toIntExact(stream.map(Path::toFile)
                                         .filter(currentFile -> isMatchingObject(query, currentFile))
                                         .count());
        } catch (IOException e) {
            throw Exceptions.handle(e);
        }
    }
1192097
@SafeVarargs
    public final boolean exists(final String query, final Object... parameters) {
        final QueryResult resultSet = execute(query, parameters);

        return resultSet.iterator().hasNext();
    }
1042003
@Override
    public QueryResult execute( String query,
                                String language ) throws RepositoryException {
        logger.trace("Executing query: {0}", query);

        // Create the query ...

        final Query jcrQuery = getLocalSession().getSession().getWorkspace().getQueryManager().createQuery(query, language);
        return jcrQuery.execute();
    }
974764
function(query) {
        var q = rql2es(_.rql(query)),
            mapFn = q.fields ?
                          function(x) { return x.fields; } 
                        : function(x) { return x._source; };
        return ajax('POST', this._url + '/_search', q)
            .then(function(result) {
                return result.hits.hits.map(mapFn);
            });
    }
479975
public List<T> query(String query, QueryType type)
    {
        switch (type)
        {
        case JPQL:
            return query(query);

        case NATIVE:
            return nativeQuery(query);

        default:
            throw new KunderaException("invalid query type");
        }
    }
294174
public ResultSet executeQuery(final String query) throws SQLException {
        startTimer();
        try {
            if (queryResult != null) {
                queryResult.close();
            }
            final Query queryToSend = queryFactory.createQuery(query);
            queryResult = protocol.executeQuery(queryToSend);
            warningsCleared = false;
            return new DrizzleResultSet(queryResult, this, getProtocol());
        } catch (QueryException e) {
            throw SQLExceptionMapper.get(e);
        } finally {
            stopTimer();
        }
    }
202483
<T> void query(Query<T> query, IOConsumer<T> f) throws IOException {
    run(() -> rw.run(query).forEachRemaining(IOConsumer.unchecked(f)));
  }
1278554
private InputStream runSparqlQuery(String query) throws IOException {
		try {
			String queryString = "query=" + URLEncoder.encode(query, "UTF-8")
					+ "&format=json";
			URL url = new URL("https://query.wikidata.org/sparql?"
					+ queryString);
			HttpURLConnection connection = (HttpURLConnection) url
					.openConnection();
			connection.setRequestMethod("GET");

			return connection.getInputStream();
		} catch (UnsupportedEncodingException | MalformedURLException e) {
			throw new RuntimeException(e.getMessage(), e);
		}
	}
555653
public BoxRequestsSearch.Search getSearchRequest(String query) {
        BoxRequestsSearch.Search request = new BoxRequestsSearch.Search(query, getSearchUrl(), mSession);
        return request;
    }
671824
public static ElDescriptor analyzeQuery(final GenericsContext genericsContext, final String query) {
        final List<String> vars = ElUtils.findVars(query);
        ElDescriptor descriptor = null;
        if (!vars.isEmpty()) {
            descriptor = new ElDescriptor(vars);
            checkGenericVars(descriptor, genericsContext);
        }
        return descriptor;
    }