/** * 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; } }
RelOptCostFactory costFactory) { final VolcanoPlanner planner = new VolcanoPlanner(costFactory, externalContext); planner.addRelTraitDef(ConventionTraitDef.INSTANCE); if (ENABLE_COLLATION_TRAIT) {
/** * 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); }
VolcanoPlanner planner = new VolcanoPlanner(); planner.addRelTraitDef(ConventionTraitDef.INSTANCE);
final VolcanoPlanner planner = new VolcanoPlanner(); planner.addRelTraitDef(ConventionTraitDef.instance); if (ENABLE_COLLATION_TRAIT) {
private void removeTrivialProject(boolean useRule) { VolcanoPlanner planner = new VolcanoPlanner(); planner.ambitious = true;
private void removeTrivialProject(boolean useRule) VolcanoPlanner planner = new VolcanoPlanner(); planner.ambitious = true;
/** * 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); }
@Ignore @Test public void testDoubleConversion() { VolcanoPlanner planner = new VolcanoPlanner();
@Ignore @Test public void testDoubleConversion() { VolcanoPlanner planner = new VolcanoPlanner();
VolcanoPlanner planner = new VolcanoPlanner(); planner.ambitious = true; planner.addRelTraitDef(ConventionTraitDef.instance);
@Ignore @Test public void testTraitPropagation() { VolcanoPlanner planner = new VolcanoPlanner();
@Ignore @Test public void testTraitPropagation() { VolcanoPlanner planner = new VolcanoPlanner();
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);