/** * Creates a simple planner that can plan "select * from myTable" but not * much more. */ protected RelOptPlanner createTapPlanner() { final VolcanoPlanner planner = new VolcanoPlanner(); planner.addRelTraitDef( Cascading.CONVENTION.getTraitDef() ); planner.addRelTraitDef( ConventionTraitDef.instance ); planner.addRule( TableAccessRule.instance ); planner.addRule( JavaRules.ENUMERABLE_CALC_RULE ); planner.addRule( ProjectToCalcRule.instance ); planner.addRule( EnumerableTapRule.INSTANCE ); planner.setLocked( true ); // prevent further rules being added return planner; } }
final VolcanoPlanner planner = new VolcanoPlanner(costFactory, externalContext); planner.addRelTraitDef(ConventionTraitDef.INSTANCE); if (ENABLE_COLLATION_TRAIT) { planner.addRelTraitDef(RelCollationTraitDef.INSTANCE); planner.registerAbstractRelationalRules();
planner.addRelTraitDef(ConventionTraitDef.instance); if (ENABLE_COLLATION_TRAIT) { planner.addRelTraitDef(RelCollationTraitDef.INSTANCE); planner.registerAbstractRelationalRules();
/** * Tests transformation of a leaf from NONE to PHYS. */ @Test public void testTransformLeaf() { VolcanoPlanner planner = new VolcanoPlanner(); planner.addRelTraitDef(ConventionTraitDef.instance); planner.addRule(new PhysLeafRule()); RelOptCluster cluster = newCluster(planner); NoneLeafRel leafRel = new NoneLeafRel( cluster, "a"); RelNode convertedRel = planner.changeTraits( leafRel, cluster.traitSetOf(PHYS_CALLING_CONVENTION)); planner.setRoot(convertedRel); RelNode result = planner.chooseDelegate().findBestExp(); assertTrue(result instanceof PhysLeafRel); }
/** * Tests transformation of a leaf from NONE to PHYS. */ @Test public void testTransformLeaf() { VolcanoPlanner planner = new VolcanoPlanner(); planner.addRelTraitDef(ConventionTraitDef.INSTANCE); planner.addRule(new PhysLeafRule()); RelOptCluster cluster = newCluster(planner); NoneLeafRel leafRel = new NoneLeafRel( cluster, "a"); RelNode convertedRel = planner.changeTraits( leafRel, cluster.traitSetOf(PHYS_CALLING_CONVENTION)); planner.setRoot(convertedRel); RelNode result = planner.chooseDelegate().findBestExp(); assertTrue(result instanceof PhysLeafRel); }
planner.addRelTraitDef(ConventionTraitDef.INSTANCE);
VolcanoPlanner planner = new VolcanoPlanner(); planner.addRelTraitDef(ConventionTraitDef.instance); planner.addRelTraitDef(ALT_TRAIT_DEF);
VolcanoPlanner planner = new VolcanoPlanner(); planner.addRelTraitDef(ConventionTraitDef.INSTANCE); planner.addRelTraitDef(ALT_TRAIT_DEF);
planner.ambitious = true; planner.addRelTraitDef(ConventionTraitDef.INSTANCE);
planner.ambitious = true; planner.addRelTraitDef(ConventionTraitDef.instance);
VolcanoPlanner planner = new VolcanoPlanner(); planner.addRelTraitDef(ConventionTraitDef.INSTANCE); planner.addRelTraitDef(ALT_TRAIT_DEF);
VolcanoPlanner planner = new VolcanoPlanner(); planner.addRelTraitDef(ConventionTraitDef.instance); planner.addRelTraitDef(ALT_TRAIT_DEF);
/** * Tests transformation of a single+leaf from NONE to PHYS. */ @Test public void testTransformSingleGood() { VolcanoPlanner planner = new VolcanoPlanner(); planner.addRelTraitDef(ConventionTraitDef.INSTANCE); planner.addRule(new PhysLeafRule()); planner.addRule(new GoodSingleRule()); RelOptCluster cluster = newCluster(planner); NoneLeafRel leafRel = new NoneLeafRel( cluster, "a"); NoneSingleRel singleRel = new NoneSingleRel( cluster, leafRel); RelNode convertedRel = planner.changeTraits( singleRel, cluster.traitSetOf(PHYS_CALLING_CONVENTION)); planner.setRoot(convertedRel); RelNode result = planner.chooseDelegate().findBestExp(); assertTrue(result instanceof PhysSingleRel); }
/** * Tests transformation of a single+leaf from NONE to PHYS. */ @Test public void testTransformSingleGood() { VolcanoPlanner planner = new VolcanoPlanner(); planner.addRelTraitDef(ConventionTraitDef.instance); planner.addRule(new PhysLeafRule()); planner.addRule(new GoodSingleRule()); RelOptCluster cluster = newCluster(planner); NoneLeafRel leafRel = new NoneLeafRel( cluster, "a"); NoneSingleRel singleRel = new NoneSingleRel( cluster, leafRel); RelNode convertedRel = planner.changeTraits( singleRel, cluster.traitSetOf(PHYS_CALLING_CONVENTION)); planner.setRoot(convertedRel); RelNode result = planner.chooseDelegate().findBestExp(); assertTrue(result instanceof PhysSingleRel); }
/** * Tests transformation of a single+leaf from NONE to PHYS. In the past, * this one didn't work due to the definition of ReformedSingleRule. */ @Test public void testTransformSingleReformed() { VolcanoPlanner planner = new VolcanoPlanner(); planner.addRelTraitDef(ConventionTraitDef.instance); planner.addRule(new PhysLeafRule()); planner.addRule(new ReformedSingleRule()); RelOptCluster cluster = newCluster(planner); NoneLeafRel leafRel = new NoneLeafRel( cluster, "a"); NoneSingleRel singleRel = new NoneSingleRel( cluster, leafRel); RelNode convertedRel = planner.changeTraits( singleRel, cluster.traitSetOf(PHYS_CALLING_CONVENTION)); planner.setRoot(convertedRel); RelNode result = planner.chooseDelegate().findBestExp(); assertTrue(result instanceof PhysSingleRel); }
/** * Tests transformation of a single+leaf from NONE to PHYS. In the past, * this one didn't work due to the definition of ReformedSingleRule. */ @Ignore // broken, because ReformedSingleRule matches child traits strictly @Test public void testTransformSingleReformed() { VolcanoPlanner planner = new VolcanoPlanner(); planner.addRelTraitDef(ConventionTraitDef.INSTANCE); planner.addRule(new PhysLeafRule()); planner.addRule(new ReformedSingleRule()); RelOptCluster cluster = newCluster(planner); NoneLeafRel leafRel = new NoneLeafRel( cluster, "a"); NoneSingleRel singleRel = new NoneSingleRel( cluster, leafRel); RelNode convertedRel = planner.changeTraits( singleRel, cluster.traitSetOf(PHYS_CALLING_CONVENTION)); planner.setRoot(convertedRel); RelNode result = planner.chooseDelegate().findBestExp(); assertTrue(result instanceof PhysSingleRel); }
VolcanoPlanner planner = new VolcanoPlanner(); planner.ambitious = true; planner.addRelTraitDef(ConventionTraitDef.instance);
VolcanoPlanner planner = new VolcanoPlanner(); planner.ambitious = true; planner.addRelTraitDef(ConventionTraitDef.INSTANCE);
VolcanoPlanner planner = new VolcanoPlanner(); planner.ambitious = true; planner.addRelTraitDef(ConventionTraitDef.INSTANCE);
VolcanoPlanner planner = new VolcanoPlanner(); planner.ambitious = true; planner.addRelTraitDef(ConventionTraitDef.instance);