Search in sources :

Example 1 with PrestoAction

use of com.facebook.presto.benchmark.prestoaction.PrestoAction in project presto by prestodb.

the class AbstractPhaseExecutor method runQuery.

protected BenchmarkQueryEvent runQuery(BenchmarkQuery benchmarkQuery) {
    Optional<QueryStats> queryStats = Optional.empty();
    Statement statement = sqlParser.createStatement(benchmarkQuery.getQuery(), parsingOptions);
    PrestoAction prestoAction = prestoActionFactory.get(benchmarkQuery);
    try {
        queryStats = Optional.of(prestoAction.execute(statement));
        return buildEvent(benchmarkQuery, queryStats, Optional.empty());
    } catch (QueryException e) {
        return buildEvent(benchmarkQuery, queryStats, Optional.of(e));
    } catch (Throwable t) {
        log.error(t);
        return buildEvent(benchmarkQuery, queryStats, Optional.empty());
    }
}
Also used : PrestoAction(com.facebook.presto.benchmark.prestoaction.PrestoAction) QueryStats(com.facebook.presto.jdbc.QueryStats) Statement(com.facebook.presto.sql.tree.Statement)

Aggregations

PrestoAction (com.facebook.presto.benchmark.prestoaction.PrestoAction)1 QueryStats (com.facebook.presto.jdbc.QueryStats)1 Statement (com.facebook.presto.sql.tree.Statement)1