use of io.druid.sql.calcite.planner.DruidPlanner in project druid by druid-io.
the class DruidStatement method prepare.
public DruidStatement prepare(final PlannerFactory plannerFactory, final String query, final long maxRowCount) {
try (final DruidPlanner planner = plannerFactory.createPlanner(queryContext)) {
synchronized (lock) {
ensure(State.NEW);
this.plannerResult = planner.plan(query);
this.maxRowCount = maxRowCount;
this.query = query;
this.signature = Meta.Signature.create(createColumnMetaData(plannerResult.rowType()), query, new ArrayList<AvaticaParameter>(), Meta.CursorFactory.ARRAY, // We only support SELECT
Meta.StatementType.SELECT);
this.state = State.PREPARED;
}
} catch (Exception e) {
throw Throwables.propagate(e);
}
return this;
}
Aggregations