Package org.apache.calcite.test
Class HepPlannerTest
- java.lang.Object
-
- org.apache.calcite.test.SqlToRelTestBase
-
- org.apache.calcite.test.RelOptTestBase
-
- org.apache.calcite.test.HepPlannerTest
-
public class HepPlannerTest extends RelOptTestBase
HepPlannerTest is a unit test forHepPlanner
. SeeRelOptRulesTest
for an explanation of how to add tests; the tests in this class are targeted at exercising the planner, and use specific rules for convenience only, whereas the tests in that class are targeted at exercising specific rules, and use the planner for convenience only. Hence the split.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
HepPlannerTest.HepTestListener
Listener for HepPlannerTest; counts how many times rules fire.-
Nested classes/interfaces inherited from class org.apache.calcite.test.RelOptTestBase
RelOptTestBase.Sql
-
Nested classes/interfaces inherited from class org.apache.calcite.test.SqlToRelTestBase
SqlToRelTestBase.MockRelOptSchema, SqlToRelTestBase.Tester, SqlToRelTestBase.TesterImpl
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
COMPLEX_UNION_TREE
private static java.lang.String
UNION_TREE
-
Fields inherited from class org.apache.calcite.test.SqlToRelTestBase
NL, tester
-
-
Constructor Summary
Constructors Constructor Description HepPlannerTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private long
checkRuleApplyCount(org.apache.calcite.plan.hep.HepMatchOrder matchOrder)
protected DiffRepository
getDiffRepos()
Returns the default diff repository for this test, or null if there is no repository.void
testCommonSubExpression()
Tests that if two relational expressions are equivalent, the planner notices, and only applies the rule once.void
testGC()
void
testGroup()
void
testMatchLimitOneBottomUp()
void
testMatchLimitOneTopDown()
void
testMatchUntilFixpoint()
void
testMaterialization()
void
testReplaceCommonSubexpression()
void
testRuleApplyCount()
void
testRuleClass()
void
testRuleDescription()
void
testSubprogram()
-
Methods inherited from class org.apache.calcite.test.RelOptTestBase
checkPlanning, checkPlanning, checkPlanning, checkPlanning, checkPlanning, checkPlanningDynamic, checkPlanningDynamic, checkPlanUnchanged, createDynamicTester, createTester, sql
-
Methods inherited from class org.apache.calcite.test.SqlToRelTestBase
assertValid, createTester, getTesterWithDynamicTable
-
-
-
-
Field Detail
-
UNION_TREE
private static final java.lang.String UNION_TREE
- See Also:
- Constant Field Values
-
COMPLEX_UNION_TREE
private static final java.lang.String COMPLEX_UNION_TREE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getDiffRepos
protected DiffRepository getDiffRepos()
Description copied from class:SqlToRelTestBase
Returns the default diff repository for this test, or null if there is no repository.The default implementation returns null.
Sub-classes that want to use a diff repository can override. Sub-sub-classes can override again, inheriting test cases and overriding selected test results.
And individual test cases can override by providing a different tester object.
- Overrides:
getDiffRepos
in classSqlToRelTestBase
- Returns:
- Diff repository
-
testRuleClass
public void testRuleClass() throws java.lang.Exception
- Throws:
java.lang.Exception
-
testRuleDescription
public void testRuleDescription() throws java.lang.Exception
- Throws:
java.lang.Exception
-
testMatchLimitOneTopDown
public void testMatchLimitOneTopDown() throws java.lang.Exception
- Throws:
java.lang.Exception
-
testMatchLimitOneBottomUp
public void testMatchLimitOneBottomUp() throws java.lang.Exception
- Throws:
java.lang.Exception
-
testMatchUntilFixpoint
public void testMatchUntilFixpoint() throws java.lang.Exception
- Throws:
java.lang.Exception
-
testReplaceCommonSubexpression
public void testReplaceCommonSubexpression() throws java.lang.Exception
- Throws:
java.lang.Exception
-
testCommonSubExpression
public void testCommonSubExpression()
Tests that if two relational expressions are equivalent, the planner notices, and only applies the rule once.
-
testSubprogram
public void testSubprogram() throws java.lang.Exception
- Throws:
java.lang.Exception
-
testGroup
public void testGroup() throws java.lang.Exception
- Throws:
java.lang.Exception
-
testGC
public void testGC() throws java.lang.Exception
- Throws:
java.lang.Exception
-
testRuleApplyCount
public void testRuleApplyCount()
-
testMaterialization
public void testMaterialization() throws java.lang.Exception
- Throws:
java.lang.Exception
-
checkRuleApplyCount
private long checkRuleApplyCount(org.apache.calcite.plan.hep.HepMatchOrder matchOrder)
-
-