use of org.apache.calcite.linq4j.tree.ParameterExpression in project calcite by apache.
the class OptimizerTest method testOptimizeTernaryAeqBBA.
@Test
public void testOptimizeTernaryAeqBBA() {
// a == b ? b : a
ParameterExpression a = Expressions.parameter(boolean.class, "a");
ParameterExpression b = Expressions.parameter(boolean.class, "b");
assertEquals("{\n return a;\n}\n", optimize(Expressions.condition(Expressions.equal(a, b), b, a)));
}
use of org.apache.calcite.linq4j.tree.ParameterExpression in project calcite by apache.
the class OptimizerTest method testNotEqualDifferentExpr.
@Test
public void testNotEqualDifferentExpr() {
// x != y
ParameterExpression x = Expressions.parameter(int.class, "x");
ParameterExpression y = Expressions.parameter(int.class, "y");
assertEquals("{\n return x != y;\n}\n", optimize(Expressions.notEqual(x, y)));
}
use of org.apache.calcite.linq4j.tree.ParameterExpression in project calcite by apache.
the class OptimizerTest method testEqualDifferentExpr.
@Test
public void testEqualDifferentExpr() {
// x == y
ParameterExpression x = Expressions.parameter(int.class, "x");
ParameterExpression y = Expressions.parameter(int.class, "y");
assertEquals("{\n return x == y;\n}\n", optimize(Expressions.equal(x, y)));
}
use of org.apache.calcite.linq4j.tree.ParameterExpression in project calcite by apache.
the class OptimizerTest method testEqualBoolFalse.
@Test
public void testEqualBoolFalse() {
// x == false
ParameterExpression x = Expressions.parameter(boolean.class, "x");
assertEquals("{\n return !x;\n}\n", optimize(Expressions.equal(x, FALSE)));
}
use of org.apache.calcite.linq4j.tree.ParameterExpression in project calcite by apache.
the class OptimizerTest method testAndAlsoXX.
@Test
public void testAndAlsoXX() {
// x && x
ParameterExpression x = Expressions.parameter(boolean.class, "x");
assertEquals("{\n return x;\n}\n", optimize(Expressions.andAlso(x, x)));
}
Aggregations