use of org.apache.calcite.linq4j.tree.ParameterExpression in project calcite by apache.
the class OptimizerTest method testNotEqualBoolFalse.
@Test
void testNotEqualBoolFalse() {
// x != false
ParameterExpression x = Expressions.parameter(boolean.class, "x");
assertEquals("{\n return x;\n}\n", optimize(Expressions.notEqual(x, FALSE)));
}
use of org.apache.calcite.linq4j.tree.ParameterExpression in project calcite by apache.
the class OptimizerTest method testOptimizeTernaryAeqBAB.
@Test
void testOptimizeTernaryAeqBAB() {
// a == b ? a : b
ParameterExpression a = Expressions.parameter(boolean.class, "a");
ParameterExpression b = Expressions.parameter(boolean.class, "b");
assertEquals("{\n return b;\n}\n", optimize(Expressions.condition(Expressions.equal(a, b), a, b)));
}
use of org.apache.calcite.linq4j.tree.ParameterExpression in project calcite by apache.
the class OptimizerTest method testNotEqualBoolTrue.
@Test
void testNotEqualBoolTrue() {
// x != true
ParameterExpression x = Expressions.parameter(boolean.class, "x");
assertEquals("{\n return !x;\n}\n", optimize(Expressions.notEqual(x, TRUE)));
}
use of org.apache.calcite.linq4j.tree.ParameterExpression in project calcite by apache.
the class OptimizerTest method testNotEqualSameExpr.
@Test
void testNotEqualSameExpr() {
// x != x
ParameterExpression x = Expressions.parameter(int.class, "x");
assertEquals("{\n return false;\n}\n", optimize(Expressions.notEqual(x, x)));
}
use of org.apache.calcite.linq4j.tree.ParameterExpression in project calcite by apache.
the class OptimizerTest method testOptimizeTernaryAneqBBA.
@Test
void testOptimizeTernaryAneqBBA() {
// a != b ? b : a
ParameterExpression a = Expressions.parameter(boolean.class, "a");
ParameterExpression b = Expressions.parameter(boolean.class, "b");
assertEquals("{\n return b;\n}\n", optimize(Expressions.condition(Expressions.notEqual(a, b), b, a)));
}
Aggregations