Search in sources :

Example 1 with QueryParser

use of com.hazelcast.jet.sql.impl.parse.QueryParser in project hazelcast by hazelcast.

the class OptimizerContext method create.

public static OptimizerContext create(HazelcastSchema rootSchema, List<List<String>> schemaPaths, List<Object> arguments, int memberCount, IMapResolver iMapResolver) {
    DistributionTraitDef distributionTraitDef = new DistributionTraitDef(memberCount);
    Prepare.CatalogReader catalogReader = createCatalogReader(rootSchema, schemaPaths);
    HazelcastSqlValidator validator = new HazelcastSqlValidator(catalogReader, arguments, iMapResolver);
    VolcanoPlanner volcanoPlanner = createPlanner(distributionTraitDef);
    HazelcastRelOptCluster cluster = createCluster(volcanoPlanner, distributionTraitDef);
    QueryParser parser = new QueryParser(validator);
    QueryConverter converter = new QueryConverter(validator, catalogReader, cluster);
    QueryPlanner planner = new QueryPlanner(volcanoPlanner);
    return new OptimizerContext(cluster, parser, converter, planner);
}
Also used : HazelcastRelOptCluster(org.apache.calcite.plan.HazelcastRelOptCluster) QueryParser(com.hazelcast.jet.sql.impl.parse.QueryParser) QueryConverter(com.hazelcast.jet.sql.impl.parse.QueryConverter) Prepare(org.apache.calcite.prepare.Prepare) HazelcastSqlValidator(com.hazelcast.jet.sql.impl.validate.HazelcastSqlValidator) VolcanoPlanner(org.apache.calcite.plan.volcano.VolcanoPlanner) DistributionTraitDef(com.hazelcast.jet.sql.impl.opt.distribution.DistributionTraitDef)

Aggregations

DistributionTraitDef (com.hazelcast.jet.sql.impl.opt.distribution.DistributionTraitDef)1 QueryConverter (com.hazelcast.jet.sql.impl.parse.QueryConverter)1 QueryParser (com.hazelcast.jet.sql.impl.parse.QueryParser)1 HazelcastSqlValidator (com.hazelcast.jet.sql.impl.validate.HazelcastSqlValidator)1 HazelcastRelOptCluster (org.apache.calcite.plan.HazelcastRelOptCluster)1 VolcanoPlanner (org.apache.calcite.plan.volcano.VolcanoPlanner)1 Prepare (org.apache.calcite.prepare.Prepare)1