use of com.hazelcast.sql.impl.optimizer.OptimizationTask in project hazelcast by hazelcast.
the class SqlServiceImpl method prepare.
private SqlPlan prepare(String schema, String sql, List<Object> arguments, SqlExpectedResultType expectedResultType) {
List<List<String>> searchPaths = prepareSearchPaths(schema);
PlanKey planKey = new PlanKey(searchPaths, sql);
SqlPlan plan = planCache.get(planKey);
if (plan == null) {
SqlCatalog catalog = new SqlCatalog(optimizer.tableResolvers());
plan = optimizer.prepare(new OptimizationTask(sql, arguments, searchPaths, catalog));
if (plan.isCacheable()) {
planCache.put(planKey, plan);
}
}
checkReturnType(plan, expectedResultType);
return plan;
}
Aggregations