Class RelOptRulesTest


  • public class RelOptRulesTest
    extends RelOptTestBase
    Unit test for rules in org.apache.calcite.rel and subpackages.

    As input, the test supplies a SQL statement and a single rule; the SQL is translated into relational algebra and then fed into a HepPlanner. The planner fires the rule on every pattern match in a depth-first left-to-right pre-order traversal of the tree for as long as the rule continues to succeed in applying its transform. (For rules which call transformTo more than once, only the last result is used.) The plan before and after "optimization" is diffed against a .ref file using DiffRepository.

    Procedure for adding a new test case:

    1. Add a new public test method for your rule, following the existing examples. You'll have to come up with an SQL statement to which your rule will apply in a meaningful way. See SqlToRelTestBase class comments for details on the schema.
    2. Run the test. It should fail. Inspect the output in target/surefire/.../RelOptRulesTest.xml. (If you are running using maven and this file does not exist, add a -X flag to the maven command line.)
    3. Verify that the "planBefore" is the correct translation of your SQL, and that it contains the pattern on which your rule is supposed to fire. If all is well, replace src/test/resources/.../RelOptRulesTest.xml and with the new target/surefire/.../RelOptRulesTest.xml.
    4. Run the test again. It should fail again, but this time it should contain a "planAfter" entry for your rule. Verify that your rule applied its transformation correctly, and then update the src/test/resources/.../RelOptRulesTest.xml file again.
    5. Run the test one last time; this time it should pass.
    • Field Detail

      • skipItem

        private final org.apache.calcite.rel.rules.PushProjector.ExprCondition skipItem
    • Constructor Detail

      • RelOptRulesTest

        public RelOptRulesTest()
    • 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 class SqlToRelTestBase
        Returns:
        Diff repository
      • testReduceNot

        public void testReduceNot()
      • testReduceNestedCaseWhen

        public void testReduceNestedCaseWhen()
      • testReduceOrCaseWhen

        public void testReduceOrCaseWhen()
      • testReduceNullableCase

        public void testReduceNullableCase()
      • testReduceNullableCase2

        public void testReduceNullableCase2()
      • testProjectToWindowRuleForMultipleWindows

        public void testProjectToWindowRuleForMultipleWindows()
      • testUnionToDistinctRule

        public void testUnionToDistinctRule()
      • testExtractJoinFilterRule

        public void testExtractJoinFilterRule()
      • testAddRedundantSemiJoinRule

        public void testAddRedundantSemiJoinRule()
      • testStrengthenJoinType

        public void testStrengthenJoinType()
      • testFullOuterJoinSimplificationToLeftOuter

        public void testFullOuterJoinSimplificationToLeftOuter()
      • testFullOuterJoinSimplificationToRightOuter

        public void testFullOuterJoinSimplificationToRightOuter()
      • testFullOuterJoinSimplificationToInner

        public void testFullOuterJoinSimplificationToInner()
      • testLeftOuterJoinSimplificationToInner

        public void testLeftOuterJoinSimplificationToInner()
      • testRightOuterJoinSimplificationToInner

        public void testRightOuterJoinSimplificationToInner()
      • testPushFilterPastAgg

        public void testPushFilterPastAgg()
      • basePushFilterPastAggWithGroupingSets

        private void basePushFilterPastAggWithGroupingSets​(boolean unchanged)
                                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPushFilterPastAggWithGroupingSets1

        public void testPushFilterPastAggWithGroupingSets1()
                                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPushFilterPastAggWithGroupingSets2

        public void testPushFilterPastAggWithGroupingSets2()
                                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testJoinProjectTranspose

        public void testJoinProjectTranspose()
      • testSortRemovalAllKeysConstant

        public void testSortRemovalAllKeysConstant()
      • testSortRemovalOneKeyConstant

        public void testSortRemovalOneKeyConstant()
      • testSemiJoinRuleExists

        public void testSemiJoinRuleExists()
      • testSemiJoinRule

        public void testSemiJoinRule()
      • testSemiJoinRuleLeft

        public void testSemiJoinRuleLeft()
        Similar to testSemiJoinRule() but LEFT.
      • testSemiJoinTrim

        public void testSemiJoinTrim()
                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testReduceAverage

        public void testReduceAverage()
      • testDistinctCountWithoutGroupBy

        public void testDistinctCountWithoutGroupBy()
      • testDistinctCount1

        public void testDistinctCount1()
      • testDistinctCount2

        public void testDistinctCount2()
      • testDistinctCountMultipleViaJoin

        public void testDistinctCountMultipleViaJoin()
        Tests implementing multiple distinct count the old way, using a join.
      • testDistinctCountMultiple

        public void testDistinctCountMultiple()
        Tests implementing multiple distinct count the new way, using GROUPING SETS.
      • testDistinctCountMultipleNoGroup

        public void testDistinctCountMultipleNoGroup()
      • testDistinctCountMixedJoin

        public void testDistinctCountMixedJoin()
      • testDistinctCountMixed

        public void testDistinctCountMixed()
      • testDistinctCountMixed2

        public void testDistinctCountMixed2()
      • testDistinctCountGroupingSets1

        public void testDistinctCountGroupingSets1()
      • testDistinctCountGroupingSets2

        public void testDistinctCountGroupingSets2()
      • testDistinctNonDistinctAggregates

        public void testDistinctNonDistinctAggregates()
      • testDistinctNonDistinctAggregatesWithGrouping2

        public void testDistinctNonDistinctAggregatesWithGrouping2()
      • testDistinctNonDistinctTwoAggregatesWithGrouping

        public void testDistinctNonDistinctTwoAggregatesWithGrouping()
      • testDistinctWithGrouping

        public void testDistinctWithGrouping()
      • testMultipleDistinctWithGrouping

        public void testMultipleDistinctWithGrouping()
      • testDistinctWithMultipleInputs

        public void testDistinctWithMultipleInputs()
      • testDistinctWithMultipleInputsAndGroupby

        public void testDistinctWithMultipleInputsAndGroupby()
      • testPushProjectPastFilter

        public void testPushProjectPastFilter()
      • testPushProjectPastJoin

        public void testPushProjectPastJoin()
      • testProjectCorrelateTransposeDynamic

        public void testProjectCorrelateTransposeDynamic()
      • testProjectCorrelateTransposeRuleLeftCorrelate

        public void testProjectCorrelateTransposeRuleLeftCorrelate()
      • testProjectCorrelateTransposeRuleSemiCorrelate

        public void testProjectCorrelateTransposeRuleSemiCorrelate()
      • testProjectCorrelateTransposeRuleAntiCorrelate

        public void testProjectCorrelateTransposeRuleAntiCorrelate()
      • testProjectCorrelateTransposeWithExprCond

        public void testProjectCorrelateTransposeWithExprCond()
      • testProjectCorrelateTranspose

        public void testProjectCorrelateTranspose()
      • testFilterProjectTransposePreventedByCorrelation

        public void testFilterProjectTransposePreventedByCorrelation()
        Tests that the default instance of FilterProjectTransposeRule does not push a Filter that contains a correlating variable.
        See Also:
        testFilterProjectTranspose()
      • testFilterProjectTranspose

        public void testFilterProjectTranspose()
        Tests a variant of FilterProjectTransposeRule that pushes a Filter that contains a correlating variable.
      • testPushProjectPastInnerJoinStrong

        public void testPushProjectPastInnerJoinStrong()
      • testPushProjectPastLeftJoin

        public void testPushProjectPastLeftJoin()
      • testPushProjectPastLeftJoinSwap

        public void testPushProjectPastLeftJoinSwap()
      • testPushProjectPastLeftJoinSwapStrong

        public void testPushProjectPastLeftJoinSwapStrong()
      • testPushProjectPastRightJoin

        public void testPushProjectPastRightJoin()
      • testPushProjectPastRightJoinStrong

        public void testPushProjectPastRightJoinStrong()
      • testPushProjectPastRightJoinSwap

        public void testPushProjectPastRightJoinSwap()
      • testPushProjectPastRightJoinSwapStrong

        public void testPushProjectPastRightJoinSwapStrong()
      • testPushProjectPastFullJoin

        public void testPushProjectPastFullJoin()
      • testPushProjectPastFullJoinStrong

        public void testPushProjectPastFullJoinStrong()
      • testPushProjectPastSetOp

        public void testPushProjectPastSetOp()
      • testPushJoinThroughUnionOnLeft

        public void testPushJoinThroughUnionOnLeft()
      • testPushJoinThroughUnionOnRight

        public void testPushJoinThroughUnionOnRight()
      • testMergeFilterWithJoinCondition

        public void testMergeFilterWithJoinCondition()
                                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testMergeFilter

        public void testMergeFilter()
                             throws java.lang.Exception
        Tests that filters are combined if they are identical.
        Throws:
        java.lang.Exception
      • testUnionMergeRule

        public void testUnionMergeRule()
                                throws java.lang.Exception
        Tests to see if the final branch of union is missed
        Throws:
        java.lang.Exception
      • testMinusMergeRule

        public void testMinusMergeRule()
                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testMergeJoinFilter

        public void testMergeJoinFilter()
                                 throws java.lang.Exception
        Tests that a filters is combined are combined if they are identical, even if one of them originates in an ON clause of a JOIN.
        Throws:
        java.lang.Exception
      • testMergeUnionAll

        public void testMergeUnionAll()
                               throws java.lang.Exception
        Tests UnionMergeRule, which merges 2 Union operators into a single Union with 3 inputs.
        Throws:
        java.lang.Exception
      • testMergeUnionDistinct

        public void testMergeUnionDistinct()
                                    throws java.lang.Exception
        Tests UnionMergeRule, which merges 2 Union DISTINCT (not ALL) operators into a single Union with 3 inputs.
        Throws:
        java.lang.Exception
      • testMergeUnionMixed

        public void testMergeUnionMixed()
                                 throws java.lang.Exception
        Tests that UnionMergeRule does nothing if its arguments have different ALL settings.
        Throws:
        java.lang.Exception
      • testMergeUnionMixed2

        public void testMergeUnionMixed2()
                                  throws java.lang.Exception
        Tests that UnionMergeRule converts all inputs to DISTINCT if the top one is DISTINCT. (Since UNION is left-associative, the "top one" is the rightmost.)
        Throws:
        java.lang.Exception
      • testMergeSetOpMixed

        public void testMergeSetOpMixed()
                                 throws java.lang.Exception
        Tests that UnionMergeRule does nothing if its arguments have are different set operators, Union and Intersect.
        Throws:
        java.lang.Exception
      • testMergeIntersect

        public void testMergeIntersect()
                                throws java.lang.Exception
        Tests UnionMergeRule.INTERSECT_INSTANCE, which merges 2 Intersect operators into a single Intersect with 3 inputs.
        Throws:
        java.lang.Exception
      • testIntersectToDistinct

        public void testIntersectToDistinct()
                                     throws java.lang.Exception
        Tests IntersectToDistinctRule, which rewrites an Intersect operator with 3 inputs.
        Throws:
        java.lang.Exception
      • testIntersectToDistinctAll

        public void testIntersectToDistinctAll()
                                        throws java.lang.Exception
        Tests that IntersectToDistinctRule correctly ignores an INTERSECT ALL. It can only handle INTERSECT DISTINCT.
        Throws:
        java.lang.Exception
      • testMergeMinus

        public void testMergeMinus()
                            throws java.lang.Exception
        Tests UnionMergeRule.MINUS_INSTANCE, which merges 2 Minus operators into a single Minus with 3 inputs.
        Throws:
        java.lang.Exception
      • testMergeMinusRightDeep

        public void testMergeMinusRightDeep()
                                     throws java.lang.Exception
        Tests UnionMergeRule.MINUS_INSTANCE does not merge Minus(a, Minus(b, c)) into Minus(a, b, c), which would be incorrect.
        Throws:
        java.lang.Exception
      • testHeterogeneousConversion

        public void testHeterogeneousConversion()
                                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPushSemiJoinPastJoinRuleLeft

        public void testPushSemiJoinPastJoinRuleLeft()
                                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPushSemiJoinPastJoinRuleRight

        public void testPushSemiJoinPastJoinRuleRight()
                                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPushSemiJoinPastFilter

        public void testPushSemiJoinPastFilter()
                                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testConvertMultiJoinRule

        public void testConvertMultiJoinRule()
                                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testReduceConstants

        public void testReduceConstants()
                                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPullNull

        public void testPullNull()
                          throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testOrAlwaysTrue

        public void testOrAlwaysTrue()
      • testOrAlwaysTrue2

        public void testOrAlwaysTrue2()
      • testReduceConstants2

        public void testReduceConstants2()
                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testReduceConstants3

        public void testReduceConstants3()
                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testReduceConstantsNullEqualsOne

        public void testReduceConstantsNullEqualsOne()
                                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testReduceConstantsCaseEquals

        public void testReduceConstantsCaseEquals()
                                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testReduceConstantsCaseEquals2

        public void testReduceConstantsCaseEquals2()
                                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testReduceConstantsCaseEquals3

        public void testReduceConstantsCaseEquals3()
                                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testSkipReduceConstantsCaseEquals

        public void testSkipReduceConstantsCaseEquals()
                                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testReduceConstantsEliminatesFilter

        public void testReduceConstantsEliminatesFilter()
                                                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testAlreadyFalseEliminatesFilter

        public void testAlreadyFalseEliminatesFilter()
                                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testReduceConstantsCalc

        public void testReduceConstantsCalc()
                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testRemoveSemiJoin

        public void testRemoveSemiJoin()
                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testRemoveSemiJoinWithFilter

        public void testRemoveSemiJoinWithFilter()
                                          throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testRemoveSemiJoinRight

        public void testRemoveSemiJoinRight()
                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testRemoveSemiJoinRightWithFilter

        public void testRemoveSemiJoinRightWithFilter()
                                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • checkPlanning

        private void checkPlanning​(java.lang.String query)
                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testConvertMultiJoinRuleOuterJoins

        public void testConvertMultiJoinRuleOuterJoins()
                                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testConvertMultiJoinRuleOuterJoins2

        public void testConvertMultiJoinRuleOuterJoins2()
                                                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testConvertMultiJoinRuleOuterJoins3

        public void testConvertMultiJoinRuleOuterJoins3()
                                                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testConvertMultiJoinRuleOuterJoins4

        public void testConvertMultiJoinRuleOuterJoins4()
                                                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPushSemiJoinPastProject

        public void testPushSemiJoinPastProject()
                                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testReduceValuesUnderFilter

        public void testReduceValuesUnderFilter()
                                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testReduceValuesUnderProject

        public void testReduceValuesUnderProject()
                                          throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testReduceValuesUnderProjectFilter

        public void testReduceValuesUnderProjectFilter()
                                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • checkReduceNullableToNotNull

        private void checkReduceNullableToNotNull​(org.apache.calcite.rel.rules.ReduceExpressionsRule rule)
      • testReduceNullableToNotNull

        public void testReduceNullableToNotNull()
                                         throws java.lang.Exception
        Test case that reduces a nullable expression to a NOT NULL literal that is cast to nullable.
        Throws:
        java.lang.Exception
      • testReduceNullableToNotNull2

        public void testReduceNullableToNotNull2()
                                          throws java.lang.Exception
        Test case that reduces a nullable expression to a NOT NULL literal.
        Throws:
        java.lang.Exception
      • testReduceConstantsIsNull

        public void testReduceConstantsIsNull()
                                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testReduceConstantsIsNotNull

        public void testReduceConstantsIsNotNull()
                                          throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testReduceConstantsNegated

        public void testReduceConstantsNegated()
                                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testReduceConstantsNegatedInverted

        public void testReduceConstantsNegatedInverted()
                                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testReduceConstantsDynamicFunction

        public void testReduceConstantsDynamicFunction()
        Checks that constant reducer duplicates calls to dynamic functions, if appropriate. CURRENT_TIMESTAMP is a dynamic function.
      • testCasePushIsAlwaysWorking

        public void testCasePushIsAlwaysWorking()
                                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testReduceValuesNull

        public void testReduceValuesNull()
                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testReduceValuesToEmpty

        public void testReduceValuesToEmpty()
                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testEmptyFilterProjectUnion

        public void testEmptyFilterProjectUnion()
                                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testEmptyProject2

        public void testEmptyProject2()
                               throws java.lang.Exception
        Same query as testEmptyProject(), and PruneEmptyRules is able to do the job that ValuesReduceRule cannot do.
        Throws:
        java.lang.Exception
      • testEmptyIntersect

        public void testEmptyIntersect()
                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testEmptyMinus

        public void testEmptyMinus()
                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testEmptyMinus2

        public void testEmptyMinus2()
                             throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testEmptyJoin

        public void testEmptyJoin()
      • testEmptyJoinLeft

        public void testEmptyJoinLeft()
      • testEmptyJoinRight

        public void testEmptyJoinRight()
      • testEmptySort

        public void testEmptySort()
      • testEmptySortLimitZero

        public void testEmptySortLimitZero()
      • testEmptyAggregate

        public void testEmptyAggregate()
      • testEmptyAggregateEmptyKey

        public void testEmptyAggregateEmptyKey()
      • testEmptyAggregateEmptyKeyWithAggregateValuesRule

        public void testEmptyAggregateEmptyKeyWithAggregateValuesRule()
      • testReduceCasts

        public void testReduceCasts()
                             throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testReduceCastTimeUnchanged

        public void testReduceCastTimeUnchanged()
                                         throws java.lang.Exception
        Tests that a cast from a TIME to a TIMESTAMP is not reduced. It is not constant because the result depends upon the current date.
        Throws:
        java.lang.Exception
      • testReduceCastAndConsts

        public void testReduceCastAndConsts()
                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testReduceCaseNullabilityChange

        public <T> void testReduceCaseNullabilityChange()
                                                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testReduceCastsNullable

        public void testReduceCastsNullable()
                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • basePushAggThroughUnion

        private void basePushAggThroughUnion()
                                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPushSumConstantThroughUnion

        public void testPushSumConstantThroughUnion()
                                             throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPushSumNullConstantThroughUnion

        public void testPushSumNullConstantThroughUnion()
                                                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPushSumNullableThroughUnion

        public void testPushSumNullableThroughUnion()
                                             throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPushSumNullableNOGBYThroughUnion

        public void testPushSumNullableNOGBYThroughUnion()
                                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPushCountStarThroughUnion

        public void testPushCountStarThroughUnion()
                                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPushCountNullableThroughUnion

        public void testPushCountNullableThroughUnion()
                                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPushMaxNullableThroughUnion

        public void testPushMaxNullableThroughUnion()
                                             throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPushMinThroughUnion

        public void testPushMinThroughUnion()
                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPushAvgThroughUnion

        public void testPushAvgThroughUnion()
                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPushSumCountStarThroughUnion

        public void testPushSumCountStarThroughUnion()
                                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPushSumConstantGroupingSetsThroughUnion

        public void testPushSumConstantGroupingSetsThroughUnion()
                                                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPushSumNullConstantGroupingSetsThroughUnion

        public void testPushSumNullConstantGroupingSetsThroughUnion()
                                                             throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPushSumNullableGroupingSetsThroughUnion

        public void testPushSumNullableGroupingSetsThroughUnion()
                                                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPushCountStarGroupingSetsThroughUnion

        public void testPushCountStarGroupingSetsThroughUnion()
                                                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPushCountNullableGroupingSetsThroughUnion

        public void testPushCountNullableGroupingSetsThroughUnion()
                                                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPushMaxNullableGroupingSetsThroughUnion

        public void testPushMaxNullableGroupingSetsThroughUnion()
                                                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPushMinGroupingSetsThroughUnion

        public void testPushMinGroupingSetsThroughUnion()
                                                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPushAvgGroupingSetsThroughUnion

        public void testPushAvgGroupingSetsThroughUnion()
                                                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPushSumCountStarGroupingSetsThroughUnion

        public void testPushSumCountStarGroupingSetsThroughUnion()
                                                          throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPushCountFilterThroughUnion

        public void testPushCountFilterThroughUnion()
                                             throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPullFilterThroughAggregate

        public void testPullFilterThroughAggregate()
                                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPullFilterThroughAggregateGroupingSets

        public void testPullFilterThroughAggregateGroupingSets()
                                                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • basePullConstantTroughAggregate

        private void basePullConstantTroughAggregate()
                                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPullConstantThroughConstLast

        public void testPullConstantThroughConstLast()
                                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPullConstantThroughAggregateSimpleNonNullable

        public void testPullConstantThroughAggregateSimpleNonNullable()
                                                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPullConstantThroughAggregatePermuted

        public void testPullConstantThroughAggregatePermuted()
                                                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPullConstantThroughAggregatePermutedConstFirst

        public void testPullConstantThroughAggregatePermutedConstFirst()
                                                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPullConstantThroughAggregatePermutedConstGroupBy

        public void testPullConstantThroughAggregatePermutedConstGroupBy()
                                                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPullConstantThroughAggregateConstGroupBy

        public void testPullConstantThroughAggregateConstGroupBy()
                                                          throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPullConstantThroughAggregateAllConst

        public void testPullConstantThroughAggregateAllConst()
                                                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPullConstantThroughAggregateAllLiterals

        public void testPullConstantThroughAggregateAllLiterals()
                                                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPullConstantThroughUnion

        public void testPullConstantThroughUnion()
                                          throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPullConstantThroughUnion2

        public void testPullConstantThroughUnion2()
                                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPullConstantThroughUnion3

        public void testPullConstantThroughUnion3()
                                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testAggregateProjectMerge

        public void testAggregateProjectMerge()
      • testAggregateGroupingSetsProjectMerge

        public void testAggregateGroupingSetsProjectMerge()
      • testAggregateExtractProjectRule

        public void testAggregateExtractProjectRule()
      • testAggregateExtractProjectRuleWithGroupingSets

        public void testAggregateExtractProjectRuleWithGroupingSets()
      • testAggregateExtractProjectRuleWithGroupingSets2

        public void testAggregateExtractProjectRuleWithGroupingSets2()
        Test with column used in both grouping set and argument to aggregate function.
      • testAggregateExtractProjectRuleWithFilter

        public void testAggregateExtractProjectRuleWithFilter()
      • testPullAggregateThroughUnion

        public void testPullAggregateThroughUnion()
      • testPullAggregateThroughUnion2

        public void testPullAggregateThroughUnion2()
      • transitiveInference

        private void transitiveInference​(org.apache.calcite.plan.RelOptRule... extraRules)
                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testTransitiveInferenceJoin

        public void testTransitiveInferenceJoin()
                                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testTransitiveInferenceProject

        public void testTransitiveInferenceProject()
                                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testTransitiveInferenceAggregate

        public void testTransitiveInferenceAggregate()
                                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testTransitiveInferenceUnion

        public void testTransitiveInferenceUnion()
                                          throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testTransitiveInferenceJoin3way

        public void testTransitiveInferenceJoin3way()
                                             throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testTransitiveInferenceJoin3wayAgg

        public void testTransitiveInferenceJoin3wayAgg()
                                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testTransitiveInferenceLeftOuterJoin

        public void testTransitiveInferenceLeftOuterJoin()
                                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testTransitiveInferenceRightOuterJoin

        public void testTransitiveInferenceRightOuterJoin()
                                                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testTransitiveInferenceFullOuterJoin

        public void testTransitiveInferenceFullOuterJoin()
                                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testTransitiveInferencePreventProjectPullUp

        public void testTransitiveInferencePreventProjectPullUp()
                                                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testTransitiveInferencePullUpThruAlias

        public void testTransitiveInferencePullUpThruAlias()
                                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testTransitiveInferenceConjunctInPullUp

        public void testTransitiveInferenceConjunctInPullUp()
                                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testTransitiveInferenceNoPullUpExprs

        public void testTransitiveInferenceNoPullUpExprs()
                                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testTransitiveInferenceUnion3way

        public void testTransitiveInferenceUnion3way()
                                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testTransitiveInferenceUnion3wayOr

        public void testTransitiveInferenceUnion3wayOr()
                                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testTransitiveInferenceConstantEquiPredicate

        public void testTransitiveInferenceConstantEquiPredicate()
                                                          throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testTransitiveInferenceComplexPredicate

        public void testTransitiveInferenceComplexPredicate()
                                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPullConstantIntoProject

        public void testPullConstantIntoProject()
                                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPullConstantIntoFilter

        public void testPullConstantIntoFilter()
                                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPullConstantIntoJoin

        public void testPullConstantIntoJoin()
                                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPullConstantIntoJoin2

        public void testPullConstantIntoJoin2()
                                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testProjectWindowTransposeRule

        public void testProjectWindowTransposeRule()
      • testProjectWindowTransposeRuleWithConstants

        public void testProjectWindowTransposeRuleWithConstants()
      • testAggregateProjectPullUpConstants

        public void testAggregateProjectPullUpConstants()
      • testAggregateProjectPullUpConstants2

        public void testAggregateProjectPullUpConstants2()
      • testPushFilterWithRank

        public void testPushFilterWithRank()
                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPushFilterWithRankExpr

        public void testPushFilterWithRankExpr()
                                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPushAggregateThroughJoin1

        public void testPushAggregateThroughJoin1()
      • testPushAggregateThroughJoin2

        public void testPushAggregateThroughJoin2()
      • testPushAggregateThroughJoin3

        public void testPushAggregateThroughJoin3()
      • testPushAggregateThroughJoin5

        public void testPushAggregateThroughJoin5()
      • testPushAggregateSumThroughJoin

        public void testPushAggregateSumThroughJoin()
        SUM is the easiest aggregate function to split.
      • testPushAggregateFunctionsThroughJoin

        public void testPushAggregateFunctionsThroughJoin()
        Push a variety of aggregate functions.
      • testPushAggregateThroughJoinDistinct

        public void testPushAggregateThroughJoinDistinct()
        Push a aggregate functions into a relation that is unique on the join key.
      • testPushAggregateSumNoGroup

        public void testPushAggregateSumNoGroup()
        Push count(*) through join, no GROUP BY.
      • testSwapOuterJoin

        public void testSwapOuterJoin()
      • testPushJoinCondDownToProject

        public void testPushJoinCondDownToProject()
      • testSortJoinTranspose1

        public void testSortJoinTranspose1()
      • testSortJoinTranspose2

        public void testSortJoinTranspose2()
      • testSortJoinTranspose3

        public void testSortJoinTranspose3()
      • testSortProjectTranspose1

        public void testSortProjectTranspose1()
      • testSortProjectTranspose2

        public void testSortProjectTranspose2()
      • testSortProjectTranspose3

        public void testSortProjectTranspose3()
      • testAggregateConstantKeyRule2

        public void testAggregateConstantKeyRule2()
        Tests AggregateProjectPullUpConstantsRule where reduction is not possible because "deptno" is the only key.
      • testAggregateConstantKeyRule3

        public void testAggregateConstantKeyRule3()
        Tests AggregateProjectPullUpConstantsRule where both keys are constants but only one can be removed.
      • testReduceExpressionsNot

        public void testReduceExpressionsNot()
      • testExpandProjectScalar

        public void testExpandProjectScalar()
                                     throws java.lang.Exception
        Tests expanding a sub-query, specifically an uncorrelated scalar sub-query in a project (SELECT clause).
        Throws:
        java.lang.Exception
      • testWhereNotInCorrelated2

        public void testWhereNotInCorrelated2()
      • testAll

        public void testAll()
      • testSome

        public void testSome()
      • testExpandProjectIn

        public void testExpandProjectIn()
                                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testExpandProjectInNullable

        public void testExpandProjectInNullable()
                                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testExpandProjectInComposite

        public void testExpandProjectInComposite()
                                          throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testExpandProjectExists

        public void testExpandProjectExists()
                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testExpandFilterScalar

        public void testExpandFilterScalar()
                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testExpandFilterIn

        public void testExpandFilterIn()
                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testExpandFilterInComposite

        public void testExpandFilterInComposite()
                                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testExpandFilterIn3Value

        public void testExpandFilterIn3Value()
                                      throws java.lang.Exception
        An IN filter that requires full 3-value logic (true, false, unknown).
        Throws:
        java.lang.Exception
      • testExpandFilterExists

        public void testExpandFilterExists()
                                    throws java.lang.Exception
        An EXISTS filter that can be converted into true/false.
        Throws:
        java.lang.Exception
      • testExpandFilterExistsSimple

        public void testExpandFilterExistsSimple()
                                          throws java.lang.Exception
        An EXISTS filter that can be converted into a semi-join.
        Throws:
        java.lang.Exception
      • testExpandFilterExistsSimpleAnd

        public void testExpandFilterExistsSimpleAnd()
                                             throws java.lang.Exception
        An EXISTS filter that can be converted into a semi-join.
        Throws:
        java.lang.Exception
      • testExpandJoinScalar

        public void testExpandJoinScalar()
                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testExpandJoinIn

        public void testExpandJoinIn()
                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testExpandJoinInComposite

        public void testExpandJoinInComposite()
                                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testExpandJoinExists

        public void testExpandJoinExists()
                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testDecorrelateExists

        public void testDecorrelateExists()
                                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testWhereInJoinCorrelated

        public void testWhereInJoinCorrelated()
      • testWhereExpressionInCorrelated

        public void testWhereExpressionInCorrelated()
      • testWhereExpressionInCorrelated2

        public void testWhereExpressionInCorrelated2()
      • testExpandWhereComparisonCorrelated

        public void testExpandWhereComparisonCorrelated()
                                                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testCustomColumnResolvingInNonCorrelatedSubQuery

        public void testCustomColumnResolvingInNonCorrelatedSubQuery()
      • testCustomColumnResolvingInCorrelatedSubQuery

        public void testCustomColumnResolvingInCorrelatedSubQuery()
      • testCustomColumnResolvingInCorrelatedSubQuery2

        public void testCustomColumnResolvingInCorrelatedSubQuery2()
      • testExtractYearMonthToRange

        public void testExtractYearMonthToRange()
      • testFilterRemoveIsNotDistinctFromRule

        public void testFilterRemoveIsNotDistinctFromRule()
      • testOversimplifiedCaseStatement

        public void testOversimplifiedCaseStatement()