Search in sources :

Example 1 with QueryPlan

use of com.bakdata.conquery.models.query.queryplan.QueryPlan in project conquery by bakdata.

the class QueryJob method get.

@Override
public Optional<EntityResult> get() {
    if (ctx.isQueryCancelled()) {
        return Optional.empty();
    }
    try {
        QueryPlan queryPlan = plan.get();
        queryPlan.init(ctx, entity);
        return queryPlan.execute(ctx, entity);
    } catch (ConqueryError e) {
        // Catch errors, propagate them with their id.
        throw new ConqueryError.ExecutionJobErrorWrapper(entity, e);
    } catch (Exception e) {
        throw new ConqueryError.ExecutionJobErrorWrapper(entity, new ConqueryError.UnknownError(e));
    }
}
Also used : ConqueryError(com.bakdata.conquery.models.error.ConqueryError) QueryPlan(com.bakdata.conquery.models.query.queryplan.QueryPlan)

Aggregations

ConqueryError (com.bakdata.conquery.models.error.ConqueryError)1 QueryPlan (com.bakdata.conquery.models.query.queryplan.QueryPlan)1