Search in sources :

Example 1 with QueryMaker

use of io.druid.sql.calcite.rel.QueryMaker in project druid by druid-io.

the class PlannerFactory method createPlanner.

public DruidPlanner createPlanner(final Map<String, Object> queryContext) {
    final PlannerContext plannerContext = PlannerContext.create(plannerConfig, queryContext);
    final QueryMaker queryMaker = new QueryMaker(walker, plannerContext);
    final FrameworkConfig frameworkConfig = Frameworks.newConfigBuilder().parserConfig(SqlParser.configBuilder().setCaseSensitive(true).setUnquotedCasing(Casing.UNCHANGED).setQuotedCasing(Casing.UNCHANGED).setQuoting(Quoting.DOUBLE_QUOTE).build()).defaultSchema(rootSchema).traitDefs(ConventionTraitDef.INSTANCE, RelCollationTraitDef.INSTANCE).convertletTable(new DruidConvertletTable(plannerContext)).operatorTable(operatorTable).programs(Rules.programs(queryMaker, operatorTable)).executor(new RexExecutorImpl(Schemas.createDataContext(null))).context(Contexts.EMPTY_CONTEXT).typeSystem(RelDataTypeSystem.DEFAULT).defaultSchema(rootSchema.getSubSchema(DruidSchema.NAME)).build();
    return new DruidPlanner(Frameworks.getPlanner(frameworkConfig), plannerContext);
}
Also used : RexExecutorImpl(org.apache.calcite.rex.RexExecutorImpl) QueryMaker(io.druid.sql.calcite.rel.QueryMaker) FrameworkConfig(org.apache.calcite.tools.FrameworkConfig)

Aggregations

QueryMaker (io.druid.sql.calcite.rel.QueryMaker)1 RexExecutorImpl (org.apache.calcite.rex.RexExecutorImpl)1 FrameworkConfig (org.apache.calcite.tools.FrameworkConfig)1