@Override void from(PlannerImpl planner) { planner.ensure(STATE_0_CLOSED); planner.reset(); } },
@Override void from(PlannerImpl planner) { planner.ensure(STATE_0_CLOSED); planner.reset(); } },
/** Creates a planner. Not a public API; call * {@link org.apache.calcite.tools.Frameworks#getPlanner} instead. */ public PlannerImpl(FrameworkConfig config) { this.config = config; this.defaultSchema = config.getDefaultSchema(); this.operatorTable = config.getOperatorTable(); this.programs = config.getPrograms(); this.parserConfig = config.getParserConfig(); this.sqlToRelConverterConfig = config.getSqlToRelConverterConfig(); this.state = State.STATE_0_CLOSED; this.traitDefs = config.getTraitDefs(); this.convertletTable = config.getConvertletTable(); this.executor = config.getExecutor(); reset(); }
/** Creates a planner. Not a public API; call * {@link org.apache.calcite.tools.Frameworks#getPlanner} instead. */ public PlannerImpl(FrameworkConfig config) { this.config = config; this.defaultSchema = config.getDefaultSchema(); this.operatorTable = config.getOperatorTable(); this.programs = config.getPrograms(); this.parserConfig = config.getParserConfig(); this.sqlToRelConverterConfig = config.getSqlToRelConverterConfig(); this.state = State.STATE_0_CLOSED; this.traitDefs = config.getTraitDefs(); this.convertletTable = config.getConvertletTable(); this.executor = config.getExecutor(); reset(); }
private void ready() { switch (state) { case STATE_0_CLOSED: reset(); } ensure(State.STATE_1_RESET); Frameworks.withPlanner( (cluster, relOptSchema, rootSchema) -> { Util.discard(rootSchema); // use our own defaultSchema typeFactory = (JavaTypeFactory) cluster.getTypeFactory(); planner = cluster.getPlanner(); planner.setExecutor(executor); return null; }, config); state = State.STATE_2_READY; // If user specify own traitDef, instead of default default trait, // first, clear the default trait def registered with planner // then, register the trait def specified in traitDefs. if (this.traitDefs != null) { planner.clearRelTraitDefs(); for (RelTraitDef def : this.traitDefs) { planner.addRelTraitDef(def); } } }
private void ready() { switch (state) { case STATE_0_CLOSED: reset(); } ensure(State.STATE_1_RESET); Frameworks.withPlanner( (cluster, relOptSchema, rootSchema) -> { Util.discard(rootSchema); // use our own defaultSchema typeFactory = (JavaTypeFactory) cluster.getTypeFactory(); planner = cluster.getPlanner(); planner.setExecutor(executor); return null; }, config); state = State.STATE_2_READY; // If user specify own traitDef, instead of default default trait, // first, clear the default trait def registered with planner // then, register the trait def specified in traitDefs. if (this.traitDefs != null) { planner.clearRelTraitDefs(); for (RelTraitDef def : this.traitDefs) { planner.addRelTraitDef(def); } } }