Package org.apache.calcite.test
Class RexTransformerTest
- java.lang.Object
-
- org.apache.calcite.test.RexTransformerTest
-
public class RexTransformerTest extends java.lang.Object
Tests transformations on rex nodes.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) org.apache.calcite.rel.type.RelDataType
boolRelDataType
(package private) org.apache.calcite.rex.RexNode
falseRex
(package private) org.apache.calcite.rex.RexBuilder
rexBuilder
(package private) org.apache.calcite.rex.RexNode
trueRex
(package private) org.apache.calcite.rel.type.RelDataTypeFactory
typeFactory
(package private) org.apache.calcite.rex.RexNode
x
(package private) org.apache.calcite.rex.RexNode
y
(package private) org.apache.calcite.rex.RexNode
z
-
Constructor Summary
Constructors Constructor Description RexTransformerTest()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private org.apache.calcite.rex.RexNode
and(org.apache.calcite.rex.RexNode a0, org.apache.calcite.rex.RexNode a1)
(package private) void
check(java.lang.Boolean encapsulateType, org.apache.calcite.rex.RexNode node, java.lang.String expected)
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)
private org.apache.calcite.rex.RexNode
equals(org.apache.calcite.rex.RexNode a0, org.apache.calcite.rex.RexNode a1)
private org.apache.calcite.rex.RexNode
greaterThan(org.apache.calcite.rex.RexNode a0, org.apache.calcite.rex.RexNode a1)
private org.apache.calcite.rex.RexNode
greaterThanOrEqual(org.apache.calcite.rex.RexNode a0, org.apache.calcite.rex.RexNode a1)
private org.apache.calcite.rex.RexNode
isFalse(org.apache.calcite.rex.RexNode node)
private org.apache.calcite.rex.RexNode
isNotNull(org.apache.calcite.rex.RexNode a0)
private org.apache.calcite.rex.RexNode
isTrue(org.apache.calcite.rex.RexNode node)
private org.apache.calcite.rex.RexNode
lessThan(org.apache.calcite.rex.RexNode a0, org.apache.calcite.rex.RexNode a1)
private org.apache.calcite.rex.RexNode
lessThanOrEqual(org.apache.calcite.rex.RexNode a0, org.apache.calcite.rex.RexNode a1)
private org.apache.calcite.rex.RexNode
not(org.apache.calcite.rex.RexNode a0)
private org.apache.calcite.rex.RexNode
notEquals(org.apache.calcite.rex.RexNode a0, org.apache.calcite.rex.RexNode a1)
private org.apache.calcite.rex.RexNode
or(org.apache.calcite.rex.RexNode a0, org.apache.calcite.rex.RexNode a1)
private org.apache.calcite.rex.RexNode
plus(org.apache.calcite.rex.RexNode a0, org.apache.calcite.rex.RexNode a1)
void
setUp()
void
testDown()
void
testExactLiteral()
void
testLogic()
Test case forLogicVisitor
.void
testMixed1()
void
testMixed2()
void
testMixed3()
void
testNonBooleans()
void
testOptimizeNonNullLiterals()
void
testOrUnchanged()
the or operator should pass through unchanged since e.g.void
testPreTests()
void
testSimpleAnd()
void
testSimpleEquals()
void
testSimpleGreaterEquals()
void
testSimpleGreaterThan()
void
testSimpleIdentifier()
void
testSimpleLessEqual()
void
testSimpleLessThan()
void
testSimpleNotEquals()
void
testSplitJoinCondition()
private static org.apache.calcite.rel.RelNode
toRel(java.lang.String sql)
Converts a SQL string to a relational expression using mock schema.
-
-
-
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
-
-
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()
-
testExactLiteral
public void testExactLiteral()
-
testSplitJoinCondition
public void testSplitJoinCondition()
-
testLogic
public void testLogic()
Test case forLogicVisitor
.
-
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)
-
-