Class RexTransformerTest


  • public class RexTransformerTest
    extends java.lang.Object
    Tests transformations on rex nodes.
    • Field Detail

      • rexBuilder

        org.apache.calcite.rex.RexBuilder rexBuilder
      • x

        org.apache.calcite.rex.RexNode x
      • y

        org.apache.calcite.rex.RexNode y
      • z

        org.apache.calcite.rex.RexNode z
      • trueRex

        org.apache.calcite.rex.RexNode trueRex
      • falseRex

        org.apache.calcite.rex.RexNode falseRex
      • boolRelDataType

        org.apache.calcite.rel.type.RelDataType boolRelDataType
      • typeFactory

        org.apache.calcite.rel.type.RelDataTypeFactory typeFactory
    • Constructor Detail

      • RexTransformerTest

        public RexTransformerTest()
    • Method Detail

      • toRel

        private static org.apache.calcite.rel.RelNode toRel​(java.lang.String sql)
        Converts a SQL string to a relational expression using mock schema.
      • setUp

        public void setUp()
      • testDown

        public void testDown()
      • check

        void check​(java.lang.Boolean encapsulateType,
                   org.apache.calcite.rex.RexNode node,
                   java.lang.String expected)
      • lessThan

        private org.apache.calcite.rex.RexNode lessThan​(org.apache.calcite.rex.RexNode a0,
                                                        org.apache.calcite.rex.RexNode a1)
      • lessThanOrEqual

        private org.apache.calcite.rex.RexNode lessThanOrEqual​(org.apache.calcite.rex.RexNode a0,
                                                               org.apache.calcite.rex.RexNode a1)
      • greaterThan

        private org.apache.calcite.rex.RexNode greaterThan​(org.apache.calcite.rex.RexNode a0,
                                                           org.apache.calcite.rex.RexNode a1)
      • greaterThanOrEqual

        private org.apache.calcite.rex.RexNode greaterThanOrEqual​(org.apache.calcite.rex.RexNode a0,
                                                                  org.apache.calcite.rex.RexNode a1)
      • equals

        private org.apache.calcite.rex.RexNode equals​(org.apache.calcite.rex.RexNode a0,
                                                      org.apache.calcite.rex.RexNode a1)
      • notEquals

        private org.apache.calcite.rex.RexNode notEquals​(org.apache.calcite.rex.RexNode a0,
                                                         org.apache.calcite.rex.RexNode a1)
      • and

        private org.apache.calcite.rex.RexNode and​(org.apache.calcite.rex.RexNode a0,
                                                   org.apache.calcite.rex.RexNode a1)
      • or

        private org.apache.calcite.rex.RexNode or​(org.apache.calcite.rex.RexNode a0,
                                                  org.apache.calcite.rex.RexNode a1)
      • not

        private org.apache.calcite.rex.RexNode not​(org.apache.calcite.rex.RexNode a0)
      • plus

        private org.apache.calcite.rex.RexNode plus​(org.apache.calcite.rex.RexNode a0,
                                                    org.apache.calcite.rex.RexNode a1)
      • isNotNull

        private org.apache.calcite.rex.RexNode isNotNull​(org.apache.calcite.rex.RexNode a0)
      • isFalse

        private org.apache.calcite.rex.RexNode isFalse​(org.apache.calcite.rex.RexNode node)
      • isTrue

        private org.apache.calcite.rex.RexNode isTrue​(org.apache.calcite.rex.RexNode node)
      • testPreTests

        public void testPreTests()
      • testNonBooleans

        public void testNonBooleans()
      • testOrUnchanged

        public void testOrUnchanged()
        the or operator should pass through unchanged since e.g. x OR y should return true if x=null and y=true if it was transformed into something like (x IS NOT NULL) AND (y IS NOT NULL) AND (x OR y) an incorrect result could be produced
      • testSimpleAnd

        public void testSimpleAnd()
      • testSimpleEquals

        public void testSimpleEquals()
      • testSimpleNotEquals

        public void testSimpleNotEquals()
      • testSimpleGreaterThan

        public void testSimpleGreaterThan()
      • testSimpleGreaterEquals

        public void testSimpleGreaterEquals()
      • testSimpleLessThan

        public void testSimpleLessThan()
      • testSimpleLessEqual

        public void testSimpleLessEqual()
      • testOptimizeNonNullLiterals

        public void testOptimizeNonNullLiterals()
      • testSimpleIdentifier

        public void testSimpleIdentifier()
      • testMixed1

        public void testMixed1()
      • testMixed2

        public void testMixed2()
      • testMixed3

        public void testMixed3()
      • testLogic

        public void testLogic()
        Test case for LogicVisitor.
      • deduceLogic

        private org.apache.calcite.plan.RelOptUtil.Logic deduceLogic​(org.apache.calcite.rex.RexNode root,
                                                                     org.apache.calcite.rex.RexNode seek,
                                                                     org.apache.calcite.plan.RelOptUtil.Logic logic)