QueryPlanner { public QueryPlanner(SchemaPlus schema) { final List<RelTraitDef> traitDefs = new ArrayList<RelTraitDef>(); traitDefs.add(ConventionTraitDef.INSTANCE); traitDefs.add(RelCollationTraitDef.INSTANCE); FrameworkConfig config = Frameworks.newConfigBuilder() .parserConfig(SqlParser.configBuilder() .setLex(Lex.MYSQL) .build()) .defaultSchema(schema) .operatorTable(SqlStdOperatorTable.instance()) .traitDefs(traitDefs) .context(Contexts.EMPTY_CONTEXT) .ruleSets(SamzaRuleSets.getRuleSets()) .costFactory(null) .typeSystem(SamzaRelDataTypeSystem.SAMZA_REL_DATATYPE_SYSTEM) .build(); this.planner = Frameworks.getPlanner(config); HepProgramBuilder hepProgramBuilder = new HepProgramBuilder(); hepProgramBuilder.addRuleClass(ReduceExpressionsRule.class); hepProgramBuilder.addRuleClass(ProjectToWindowRule.class); this.hepPlanner = new HepPlanner(hepProgramBuilder.build()); this.hepPlanner.addRule(ReduceExpressionsRule.CALC_INSTANCE); this.hepPlanner.addRule(ProjectToWindowRule.PROJECT); } QueryPlanner(SchemaPlus schema); OperatorRouter getOperatorRouter(String query); SamzaRel getPlan(String query); static final int STREAM_RULES; static final int SAMZA_REL_CONVERSION_RULES; }
@Test public void testQueryPlanner() throws IOException, SQLException { }